/* ── 색상 토큰 ─────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-side: #f7f7f5;
  --bg-hover: #efefed;
  --bg-active: #e8e8e5;
  --bg-elev: #ffffff;
  --bg-col: #f7f7f5;
  --line: #e9e9e7;
  --line-strong: #d6d6d3;
  --text: #37352f;
  --text-2: #787774;
  --text-3: #a5a4a0;
  --accent: #2383e2;
  --accent-bg: #e7f1fb;
  --danger: #d44c47;
  --overdue: #d44c47;
  --today: #eb5757;
  --shadow: 0 1px 2px rgba(15,15,15,.06), 0 6px 24px rgba(15,15,15,.12);

  --c-gray-bg: #e3e2e0;   --c-gray-fg: #32302c;
  --c-red-bg: #ffe2dd;    --c-red-fg: #5d1715;
  --c-orange-bg: #fadec9; --c-orange-fg: #49290e;
  --c-yellow-bg: #fdecc8; --c-yellow-fg: #402c1b;
  --c-green-bg: #dbeddb;  --c-green-fg: #1c3829;
  --c-blue-bg: #d3e5ef;   --c-blue-fg: #183347;
  --c-purple-bg: #e8deee; --c-purple-fg: #412454;
  --c-pink-bg: #f5e0e9;   --c-pink-fg: #4c2337;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --bg-side: #202020; --bg-hover: #2c2c2c; --bg-active: #333333; --bg-elev: #252525; --bg-col: #202020;
    --line: #2f2f2f; --line-strong: #3f3f3f; --text: #e6e6e4; --text-2: #9b9b9b; --text-3: #6f6f6f;
    --accent: #4a9eed; --accent-bg: #1f3347; --danger: #e5675f; --overdue: #ef7a72; --today: #ef7a72;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.5);
    --c-gray-bg: #3c3c3c;   --c-gray-fg: #d4d4d4;
    --c-red-bg: #5c2a28;    --c-red-fg: #ffd4cf;
    --c-orange-bg: #5c3b23; --c-orange-fg: #fbd9bd;
    --c-yellow-bg: #5a4a20; --c-yellow-fg: #f8e6b5;
    --c-green-bg: #2b4a35;  --c-green-fg: #cbe8d0;
    --c-blue-bg: #24405a;   --c-blue-fg: #cde3f3;
    --c-purple-bg: #45305a; --c-purple-fg: #e5d6f0;
    --c-pink-bg: #55283c;   --c-pink-fg: #f6d3e1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --bg-side: #202020; --bg-hover: #2c2c2c; --bg-active: #333333; --bg-elev: #252525; --bg-col: #202020;
  --line: #2f2f2f; --line-strong: #3f3f3f; --text: #e6e6e4; --text-2: #9b9b9b; --text-3: #6f6f6f;
  --accent: #4a9eed; --accent-bg: #1f3347; --danger: #e5675f; --overdue: #ef7a72; --today: #ef7a72;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.5);
  --c-gray-bg: #3c3c3c;   --c-gray-fg: #d4d4d4;
  --c-red-bg: #5c2a28;    --c-red-fg: #ffd4cf;
  --c-orange-bg: #5c3b23; --c-orange-fg: #fbd9bd;
  --c-yellow-bg: #5a4a20; --c-yellow-fg: #f8e6b5;
  --c-green-bg: #2b4a35;  --c-green-fg: #cbe8d0;
  --c-blue-bg: #24405a;   --c-blue-fg: #cde3f3;
  --c-purple-bg: #45305a; --c-purple-fg: #e5d6f0;
  --c-pink-bg: #55283c;   --c-pink-fg: #f6d3e1;
  color-scheme: dark;
}

/* ── 기본 ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
kbd { font: 11px/1 ui-monospace, monospace; color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--bg-elev);
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.small { height: 26px; padding: 0 8px; font-size: 13px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 6px; color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.small { min-width: 22px; height: 22px; font-size: 14px; }

/* ── 로그인 ────────────────────────────────────────────────────── */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; background: var(--bg-side); }
.login-card {
  width: 100%; max-width: 320px; padding: 32px 24px; border-radius: 12px;
  background: var(--bg-elev); box-shadow: var(--shadow); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-icon { font-size: 40px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; }
.login-card input {
  height: 44px; text-align: center; font-size: 22px; letter-spacing: 8px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.login-card .btn { height: 40px; justify-content: center; }
.login-msg { min-height: 20px; color: var(--danger); font-size: 13px; }

/* ── 레이아웃 ──────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  width: 240px; flex: none; background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 10px 8px; overflow-y: auto;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; }
.logo { font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 5px 8px; border-radius: 6px; color: var(--text-2); font-size: 14px;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-active); color: var(--text); font-weight: 500; }
.nav-item .ni { width: 20px; text-align: center; flex: none; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.nav-item .count.alert { color: var(--overdue); font-weight: 600; }
.side-section { margin-top: 16px; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 4px; font-size: 12px; color: var(--text-3); font-weight: 500;
}
.tag-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin: 0 5px; }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 24px;
  border-bottom: 1px solid var(--line);
}
.quick-add {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; border-radius: 8px; background: var(--bg-side); border: 1px solid transparent;
}
.quick-add:focus-within { border-color: var(--accent); background: var(--bg); }
.qa-plus { color: var(--text-3); }
.quick-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.search-btn { margin-left: auto; }
.content { flex: 1; overflow: auto; padding: 20px 24px 60px; }

.page-title { font-size: 28px; font-weight: 700; margin: 8px 0 16px; display: flex; align-items: center; gap: 10px; }

/* ── 보기 탭 + 툴바 ────────────────────────────────────────────── */
.view-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.view-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.view-tab .more { opacity: 0; font-size: 12px; padding: 0 2px; border-radius: 4px; }
.view-tab.active .more, .view-tab:hover .more { opacity: .7; }
.view-tab .more:hover { background: var(--bg-hover); opacity: 1; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border-radius: 14px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; background: var(--bg);
}
.chip-btn:hover { background: var(--bg-hover); }
.chip-btn.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.toolbar select {
  height: 28px; border-radius: 14px; border: 1px solid var(--line-strong); padding: 0 8px;
  background: var(--bg); color: var(--text-2); font-size: 13px;
}
.toolbar .sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }
.toolbar .grow { flex: 1; }

/* ── 상태/태그 배지 ────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 22px;
  border-radius: 11px; font-size: 12px; white-space: nowrap; line-height: 22px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.nodot::before { display: none; }
.tag { border-radius: 4px; padding: 0 6px; }
.tag::before { display: none; }
.st-todo  { background: var(--c-gray-bg);   color: var(--c-gray-fg); }
.st-doing { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.st-hold  { background: var(--c-yellow-bg); color: var(--c-yellow-fg); }
.st-done  { background: var(--c-green-bg);  color: var(--c-green-fg); }
.pr-high   { background: var(--c-red-bg);    color: var(--c-red-fg); }
.pr-normal { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.pr-low    { background: var(--c-gray-bg);   color: var(--c-gray-fg); }
.c-gray   { background: var(--c-gray-bg);   color: var(--c-gray-fg); }
.c-red    { background: var(--c-red-bg);    color: var(--c-red-fg); }
.c-orange { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.c-yellow { background: var(--c-yellow-bg); color: var(--c-yellow-fg); }
.c-green  { background: var(--c-green-bg);  color: var(--c-green-fg); }
.c-blue   { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.c-purple { background: var(--c-purple-bg); color: var(--c-purple-fg); }
.c-pink   { background: var(--c-pink-bg);   color: var(--c-pink-fg); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.due { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.due.overdue { color: var(--overdue); font-weight: 500; }
.due.today { color: var(--today); font-weight: 600; }
.is-done .t-title { color: var(--text-3); text-decoration: line-through; }

/* ── 표 보기 ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table.grid { width: 100%; border-collapse: collapse; min-width: 860px; }
.grid th {
  text-align: left; font-weight: 400; color: var(--text-2); font-size: 13px;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { background: var(--bg-hover); }
.grid td { padding: 0 8px; height: 38px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:hover td { background: var(--bg-side); }
.grid td.title-cell { min-width: 240px; }
.t-title { cursor: pointer; font-weight: 500; }
.t-title:hover { text-decoration: underline; text-decoration-color: var(--text-3); }
.t-meta { margin-left: 6px; font-size: 12px; color: var(--text-3); }
.cell-select, .cell-date {
  border: 0; background: transparent; padding: 4px; border-radius: 4px; cursor: pointer; max-width: 100%;
}
.cell-select:hover, .cell-date:hover { background: var(--bg-hover); }
.cell-select.pill { padding: 0 8px; appearance: none; -webkit-appearance: none; }
.cell-date { color: var(--text-2); font-size: 13px; width: 130px; }
.cell-date.overdue { color: var(--overdue); }
.star-btn { color: var(--text-3); font-size: 15px; width: 24px; }
.star-btn.on { color: #e9a23b; }
.prog { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.prog-bar { width: 60px; height: 6px; border-radius: 3px; background: var(--bg-active); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--accent); }
.add-row { display: flex; align-items: center; gap: 6px; padding: 8px; color: var(--text-3); width: 100%; text-align: left; }
.add-row:hover { background: var(--bg-hover); color: var(--text-2); }
.empty { padding: 32px; text-align: center; color: var(--text-3); }

/* ── 보드 보기 ─────────────────────────────────────────────────── */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.col { flex: 0 0 272px; background: var(--bg-col); border-radius: 8px; padding: 8px; }
.col-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 8px; }
.col-head .count { color: var(--text-3); font-size: 13px; }
.col-body { display: flex; flex-direction: column; gap: 6px; min-height: 40px; border-radius: 6px; }
.col-body.drop { background: var(--accent-bg); outline: 2px dashed var(--accent); outline-offset: 2px; }
.card {
  background: var(--bg-elev); border-radius: 6px; padding: 8px 10px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15,15,15,.06); display: flex; flex-direction: column; gap: 6px;
}
.card:hover { background: var(--bg-hover); }
.card.dragging { opacity: .4; }
.card-title { font-weight: 500; word-break: break-word; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.drop-line { height: 3px; border-radius: 2px; background: var(--accent); margin: -2px 0; }

/* ── 캘린더 보기 ───────────────────────────────────────────────── */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head h3 { margin: 0 8px 0 0; font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-dow { padding: 4px 8px; font-size: 12px; color: var(--text-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-dow.sun { color: var(--danger); }
.cal-day {
  min-height: 112px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer;
}
.cal-day:hover { background: var(--bg-side); }
.cal-day.other { background: var(--bg-side); }
.cal-day.other .cal-num { color: var(--text-3); }
.cal-day.drop { background: var(--accent-bg); }
.cal-num { font-size: 12px; color: var(--text-2); align-self: flex-end; padding: 0 4px; border-radius: 10px; min-width: 22px; text-align: center; }
.cal-day.is-today .cal-num { background: var(--today); color: #fff; font-weight: 600; }
.cal-ev {
  font-size: 12px; padding: 1px 6px; border-radius: 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--bg-elev); box-shadow: 0 0 0 1px var(--line);
}
.cal-ev:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.cal-ev.span { background: var(--accent-bg); box-shadow: none; }
.cal-ev.done { color: var(--text-3); text-decoration: line-through; }
.cal-ev.overdue { color: var(--overdue); }
.cal-more { font-size: 11px; color: var(--text-3); padding: 0 6px; }
.nodate { margin-top: 20px; }
.nodate h4 { margin: 0 0 8px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.nodate .list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── 홈 ────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-align: left; }
.stat:hover { background: var(--bg-side); }
.stat .lbl { font-size: 13px; color: var(--text-2); }
.stat .num { font-size: 28px; font-weight: 700; line-height: 1.3; }
.stat.alert .num { color: var(--overdue); }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.box h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.box h3 .count { color: var(--text-3); font-weight: 400; font-size: 13px; }
.row-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; min-width: 0;
}
.row-item:hover { background: var(--bg-hover); }
.row-item .t-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check {
  width: 18px; height: 18px; flex: none; border-radius: 4px; border: 1.5px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }
.box .empty { padding: 12px; font-size: 13px; }

/* ── 휴지통 ────────────────────────────────────────────────────── */
.trash-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.trash-row .t-title { flex: 1; cursor: default; }
.trash-row .t-title:hover { text-decoration: none; }

/* ── 사이드 패널 ───────────────────────────────────────────────── */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--bg-elev); box-shadow: var(--shadow); z-index: 30;
  transform: translateX(105%); transition: transform .18s ease; display: flex; flex-direction: column;
}
.panel.open { transform: none; }
.panel-top { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.panel-top .saved { font-size: 12px; color: var(--text-3); margin-right: auto; padding-left: 4px; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px 28px 40px; }
.panel-title {
  width: 100%; border: 0; outline: 0; background: transparent; font-size: 26px; font-weight: 700;
  resize: none; padding: 0; line-height: 1.3; overflow: hidden;
}
.props { margin: 16px 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); row-gap: 2px; align-items: center; }
.props .k { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; height: 34px; }
.props .v { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.props select, .props input[type="date"] {
  border: 0; background: transparent; padding: 4px 6px; border-radius: 4px; cursor: pointer;
}
.props select:hover, .props input[type="date"]:hover { background: var(--bg-hover); }
/* 배지 모양 select: .pill 의 고정 높이(22px)에 위아래 여백이 더해져 글자가 잘리지 않도록 */
.props select.pill, .cell-select.pill { height: 26px; line-height: normal; padding: 0 8px; border-radius: 13px; }
.props input[type="range"] { width: 160px; accent-color: var(--accent); }
.tag-x { margin-left: 2px; opacity: .6; font-size: 11px; }
.tag-x:hover { opacity: 1; }
.add-tag-btn { color: var(--text-3); font-size: 13px; padding: 2px 6px; border-radius: 4px; }
.add-tag-btn:hover { background: var(--bg-hover); color: var(--text-2); }
.section-h { font-size: 13px; color: var(--text-2); margin: 20px 0 6px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.memo {
  width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 10px;
  background: var(--bg); resize: vertical; outline: 0; line-height: 1.6;
}
.memo:focus { border-color: var(--accent); }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.ci { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.ci input[type="text"] { flex: 1; border: 0; outline: 0; background: transparent; padding: 4px 0; }
.ci.done input[type="text"] { color: var(--text-3); text-decoration: line-through; }
.ci .del { opacity: 0; color: var(--text-3); }
.ci:hover .del { opacity: 1; }
.ci-add { color: var(--text-3); padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.ci-add:hover { color: var(--text-2); }
.ci-progress { font-weight: 400; color: var(--text-3); }
.panel-foot { font-size: 12px; color: var(--text-3); margin-top: 28px; line-height: 1.8; }

/* ── 메뉴 · 모달 · 토스트 ──────────────────────────────────────── */
.menu {
  position: fixed; z-index: 50; min-width: 200px; max-height: 320px; overflow-y: auto;
  background: var(--bg-elev); border-radius: 8px; box-shadow: var(--shadow); padding: 4px;
}
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 4px; font-size: 14px; }
.menu-item:hover, .menu-item.focus { background: var(--bg-hover); }
.menu-item.danger { color: var(--danger); }
.menu-item .chk { margin-left: auto; color: var(--accent); }
.menu input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 8px; margin-bottom: 4px;
  background: var(--bg); outline: 0;
}
.menu input:focus { border-color: var(--accent); }
.menu-label { font-size: 12px; color: var(--text-3); padding: 6px 8px 2px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.swatches { display: flex; gap: 6px; padding: 6px 8px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 4px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15,15,15,.4); display: flex; justify-content: center; padding: 12vh 16px 16px; }
.modal-card { width: 100%; max-width: 560px; background: var(--bg-elev); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; align-self: flex-start; }
.search-card input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 16px; outline: 0; background: transparent; }
.search-results { max-height: 50vh; overflow-y: auto; padding: 4px; }
.search-results .row-item.focus { background: var(--bg-hover); }
.search-results .snippet { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: #2f2f2f; color: #fff; border-radius: 8px; padding: 10px 14px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.toast.error { background: var(--danger); }
.toast button { color: #8cc4ff; font-weight: 600; }

.scrim { display: none; }
.only-mobile { display: none; }

/* ── 모바일 ────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .only-mobile { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 260px;
    transform: translateX(-105%); transition: transform .18s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15,15,15,.35); }
  .topbar { padding: 8px 16px; }
  .search-btn kbd { display: none; }
  .content { padding: 12px 16px 60px; }
  .page-title { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-body { padding: 16px 16px 40px; }
  .props { grid-template-columns: 90px minmax(0, 1fr); }
  .cal-day { min-height: 72px; padding: 2px; }
  .cal-ev { font-size: 10px; padding: 0 3px; }
  .cal-dow { padding: 4px; }
}
