/* ===== 디자인 토큰 ===== */
:root {
  --bg: #ffffff;
  --bg-secondary: #f7f7f5;
  --bg-tertiary: #eeede9;
  --hover: #f1f0ec;
  --border: #ebeae5;
  --border-strong: #dad9d2;
  --text: #25241f;
  --text-secondary: #6a695f;
  --text-tertiary: #a4a399;
  --accent: #2f6fed;
  --accent-hover: #2360d6;
  --accent-bg: #e9f1fe;
  --accent-text: #1b56c9;
  --danger: #db4d4d;
  --danger-bg: #fbebeb;
  --success: #1c9b6d;
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .05);
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 4px 12px rgba(20, 20, 20, .06);
  --shadow-lg: 0 12px 40px rgba(20, 20, 20, .18);
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 13px;
  --sidebar-w: 232px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", Pretendard, Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #1b1b1a;
  --bg-secondary: #212120;
  --bg-tertiary: #2b2b29;
  --hover: #2d2d2b;
  --border: #34332f;
  --border-strong: #45443f;
  --text: #e9e8e3;
  --text-secondary: #a7a69e;
  --text-tertiary: #74736d;
  --accent: #5b82f0;
  --accent-hover: #6d90f3;
  --accent-bg: #21304e;
  --accent-text: #a9c5ff;
  --danger: #e06a6a;
  --danger-bg: #3a2525;
  --success: #34b083;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; -webkit-text-size-adjust: 100%; }
.sidebar-backdrop { display: none; }
.table-scroll { width: 100%; }
body {
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; transition: background .2s, color .2s;
}
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-tertiary); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3 { color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid var(--bg); }

/* ===== 버튼 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); border-radius: var(--radius-sm);
  font-size: 13.5px; transition: background .12s, border-color .12s, transform .08s; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-block { width: 100%; }

/* ===== 폼 ===== */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.input {
  height: 38px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; }
.form-error { color: var(--danger); font-size: 13px; margin: -2px 0 10px; min-height: 18px; }
.form-ok { color: var(--success); font-size: 13px; margin: -2px 0 10px; min-height: 18px; }

/* 색상 스와치 */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.swatch:hover { transform: scale(1.12); }
.swatch.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }

/* ===== 로그인 ===== */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--bg-secondary); }
.login-card {
  width: 100%; max-width: 380px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 30px; box-shadow: var(--shadow);
}
.login-logo { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 22px; margin-bottom: 18px; }
.login-card h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.login-card .sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 26px; }

/* ===== 앱 레이아웃 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-secondary);
  border-right: 1px solid var(--border); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh;
}
.ws-name { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; padding: 6px 8px 16px; }
.ws-logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 500; }
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 20px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-spacer { margin-top: auto; }
.nav-foot { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.nav-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: 13px; color: var(--text-secondary); }
.nav-tools { display: flex; gap: 4px; margin-top: 4px; }
.nav-tools .btn { flex: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.topbar h2 { font-size: 17px; font-weight: 600; margin: 0; }
.content { padding: 24px 26px; flex: 1; max-width: 1100px; width: 100%; }

/* ===== 공통 ===== */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.placeholder { display: grid; place-items: center; gap: 10px; text-align: center; color: var(--text-tertiary); padding: 64px 20px; }
.placeholder .big { font-size: 34px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; background: var(--bg-tertiary); color: var(--text-secondary); }
.badge.admin { background: var(--accent-bg); color: var(--accent-text); }
.row { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--text-secondary); font-size: 13px; }
.section-title { font-size: 14.5px; font-weight: 600; margin: 0 0 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
table.list th { color: var(--text-secondary); font-weight: 500; }
table.list tr:last-child td { border-bottom: none; }

/* ===== 홈 피드 / 내 할 일 ===== */
.welcome { background: linear-gradient(0deg, var(--bg), var(--bg)); }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; color: var(--text); background: var(--bg); transition: background .12s; }
.feed-item:hover { background: var(--hover); }
.feed-item .feed-date { margin-left: auto; color: var(--text-tertiary); font-size: 12px; flex-shrink: 0; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.mini-task { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 7px; }
.mini-task .prio-dot { position: static; }
.mini-task .mt-due { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
.mini-task .mt-due.overdue { color: var(--danger); }

/* ===== 알림 카드 ===== */
.notif-card .notif-item { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.notif-card .notif-item:hover { background: var(--hover); }
.notif-text { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; }

/* ===== 파일 자료실 ===== */
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--bg); }
.file-row:hover { border-color: var(--border-strong); }
.file-ic { font-size: 22px; flex-shrink: 0; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--text-secondary); }
.drive-list { display: flex; flex-direction: column; }
.drive-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--bg); }
.drive-row:hover { border-color: var(--border-strong); }
.drive-row.folder { cursor: pointer; background: var(--bg-secondary); }
.file-note { font-size: 12px; color: var(--text-secondary); margin-top: 5px; background: var(--bg-tertiary); padding: 4px 9px; border-radius: 6px; white-space: pre-wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; }
.crumb { cursor: pointer; color: var(--text-secondary); padding: 3px 7px; border-radius: 6px; }
.crumb:hover { background: var(--hover); color: var(--text); }
.crumb:last-child { color: var(--text); font-weight: 500; }
.crumb-sep { color: var(--text-tertiary); }

/* ===== 필터 / 세그먼트 ===== */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { padding: 6px 14px; background: var(--bg); border: none; color: var(--text-secondary); font-size: 13px; transition: background .12s; }
.seg-btn.active { background: var(--accent); color: #fff; }
.seg-btn:not(.active):hover { background: var(--hover); }

/* ===== 업무일지: 내 일지 ===== */
.day-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.score-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.score-stat { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; font-size: 13px; color: var(--text-secondary); }
.score-stat b { color: var(--accent-text); font-size: 16px; font-weight: 600; margin-left: 5px; }
.day-label { font-weight: 600; font-size: 14px; margin-left: 4px; }
.save-status { font-size: 12px; color: var(--text-tertiary); min-width: 58px; transition: color .2s; }
.day-range { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.day-grid-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow-sm); }
.grid-head, .grid-row { display: grid; grid-template-columns: 124px 1fr 66px; }
.grid-head { background: var(--bg-secondary); font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.grid-head span { padding: 9px 12px; }
.grid-head span + span, .grid-row > * + * { border-left: 1px solid var(--border); }
.grid-row { border-top: 1px solid var(--border); transition: background .1s; }
.grid-row:hover { background: var(--bg-secondary); }
.grid-time { display: flex; align-items: center; padding: 6px 12px; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; background: var(--bg-secondary); }
.grid-body { border: none; background: transparent; padding: 8px 12px; resize: none; font: inherit; color: var(--text); width: 100%; line-height: 1.55; overflow: hidden; }
.grid-body:focus { outline: none; background: var(--accent-bg); }
.grid-score { border: none; background: transparent; text-align: center; font: inherit; color: var(--text); width: 100%; appearance: textfield; -moz-appearance: textfield; }
.grid-score:focus { outline: none; background: var(--accent-bg); }
.day-cols { display: grid; grid-template-columns: 1fr 1.45fr; gap: 16px; align-items: start; }
.memo { min-height: 300px; resize: vertical; }
.todo-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.todo-row .todo-body { flex: 1; height: 32px; }
.todo-row input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); }

/* ===== 업무일지: 타임라인 ===== */
.tl-date { font-size: 13px; font-weight: 600; color: var(--text-tertiary); margin: 20px 0 10px; }
.log-card { margin-bottom: 12px; }
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.log-item { display: flex; gap: 12px; padding: 4px 0; font-size: 14px; align-items: flex-start; }
.log-time { color: var(--accent-text); font-variant-numeric: tabular-nums; min-width: 96px; flex-shrink: 0; font-size: 13px; padding-top: 1px; }
.log-body { flex: 1; min-width: 0; }
.log-score { margin-left: auto; background: var(--accent-bg); color: var(--accent-text); border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 600; height: 21px; display: inline-flex; align-items: center; flex-shrink: 0; }
.log-todos { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.log-todo { font-size: 13px; padding: 1px 0; }
.log-todo.done { color: var(--text-tertiary); text-decoration: line-through; }
.log-content { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 14px; }
.log-body p, .log-content p { margin: 0 0 6px; }
.log-body ul, .log-body ol, .log-content ul, .log-content ol { margin: 4px 0; padding-left: 20px; }
.log-body code, .log-content code, .note-body code { background: var(--bg-tertiary); padding: 1px 5px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.log-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.log-comments { margin-top: 10px; }

/* ===== 댓글 ===== */
.comments { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.cmt { display: flex; gap: 8px; margin-bottom: 9px; align-items: flex-start; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-author { font-weight: 500; font-size: 13px; }
.cmt-time { font-size: 11px; color: var(--text-tertiary); margin-left: 6px; }
.cmt-body { font-size: 14px; }
.cmt-del { color: var(--text-tertiary); font-size: 12px; }
.cmt-input-row { display: flex; gap: 6px; margin-top: 8px; }
.cmt-thread { margin-bottom: 10px; }
.cmt.reply { margin-left: 30px; margin-top: 6px; }
.cmt-replies:not(:empty) { margin-top: 2px; }
.cmt-reply-btn { border: none; background: none; color: var(--text-tertiary); font-size: 12px; padding: 2px 0; margin-top: 2px; }
.cmt-reply-btn:hover { color: var(--accent-text); }
.cmt-reply-input { display: flex; gap: 6px; margin: 6px 0 0 30px; }

/* 내 일지 상단 댓글 카드 */
.mycmt-card { margin-bottom: 16px; padding: 14px 18px; }
.mycmt-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; background: none; color: var(--text); font-size: 14px; font-weight: 500; padding: 0; }
.mycmt-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 12px; font-weight: 600; margin-left: 4px; }
.mycmt-badge.has { background: var(--accent); color: #fff; }
.mycmt-caret { color: var(--text-tertiary); font-size: 12px; }

/* ── 캘린더 ── */
.cal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { font-weight: 600; font-size: 15px; min-width: 110px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-dow { padding: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.cal-dow.sun { color: #d4537e; } .cal-dow.sat { color: #2f6fed; }
.cal-cell { min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.empty { background: var(--bg-secondary); }
.cal-day { font-size: 12px; color: var(--text-tertiary); margin-bottom: 5px; }
.cal-cell.today .cal-day { color: #fff; background: var(--accent); border-radius: 50%; width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; }
.cal-chip { display: block; width: 100%; text-align: left; border: none; background: var(--bg-secondary); border-radius: 5px; padding: 3px 7px; font-size: 12px; margin-bottom: 3px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { background: var(--hover); }

/* ── 목표 ── */
.goals-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.goal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.goal-period { min-width: 92px; text-align: center; }
.goal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goal-label { display: block; font-size: 13px; color: var(--text-secondary); font-weight: 500; margin-bottom: 6px; }
.goal-ta { min-height: 150px; resize: vertical; line-height: 1.6; }

/* ===== 칸반 ===== */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kanban-col { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 12px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 2px 6px 10px; }
.kanban-count { background: var(--bg-tertiary); color: var(--text-secondary); border-radius: 20px; padding: 1px 8px; font-size: 12px; }
.kanban-cards { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.task-card { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px 11px 17px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .08s; }
.task-card:hover { border-color: var(--border-strong); }
.task-card:active { transform: scale(.99); }
.task-card.dragging { opacity: .45; }
.prio-dot { position: absolute; left: 8px; top: 14px; width: 7px; height: 7px; border-radius: 50%; }
.task-title { font-size: 14px; margin-bottom: 9px; line-height: 1.4; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.task-meta-right { display: flex; align-items: center; gap: 8px; }
.task-noassign { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border-strong); color: var(--text-tertiary); font-size: 11px; }
.task-due { font-size: 12px; color: var(--text-tertiary); }
.task-due.overdue { color: var(--danger); }
.task-cmt { font-size: 12px; color: var(--text-tertiary); }

/* ===== 브레인스톰 ===== */
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bs-card { cursor: pointer; transition: border-color .12s, transform .08s; }
.bs-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.bs-card h3 { margin: 0 0 8px; font-size: 15px; }
.bs-board { columns: 3 240px; column-gap: 14px; }
.note-card { break-inside: avoid; margin-bottom: 14px; border-radius: var(--radius-lg); padding: 14px 15px; border: 1px solid rgba(0,0,0,.06); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .note-card { border-color: rgba(255,255,255,.08); }
.note-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; color: #2c2a22; }
.note-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.note-author { font-size: 12px; color: #6a675c; display: flex; align-items: center; gap: 6px; }
.like-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: none; background: rgba(0,0,0,.05); color: #555; border-radius: 20px; padding: 3px 10px; font-size: 12px; }
.like-btn.liked { background: var(--danger-bg); color: var(--danger); }
.note-edit { border: none; background: rgba(0,0,0,.05); color: #555; border-radius: 6px; padding: 3px 7px; font-size: 12px; }
.add-note-bar { margin-bottom: 16px; }

/* ===== 모달 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ===== 반응형 ===== */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 30; width: 80vw; max-width: 300px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 25; }
  .menu-btn { display: inline-flex !important; }

  .topbar { padding: 10px 14px; position: sticky; }
  .topbar h2 { font-size: 16px; }
  #topActions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .content { padding: 16px 14px; overflow-x: hidden; }

  .kanban, .day-cols, .home-grid { grid-template-columns: 1fr; }
  .grid-head, .grid-row { grid-template-columns: 84px 1fr 46px; }
  .grid-time { padding: 6px 8px; font-size: 12px; }
  .day-range { margin-left: 0; width: 100%; }
  .bs-board { columns: 1; }
  .goal-cols { grid-template-columns: 1fr; }
  .cal-cell { min-height: 70px; padding: 4px; }
  .cal-chip { font-size: 11px; padding: 2px 4px; }
  .cal-dow { padding: 6px 2px; font-size: 11px; }

  /* 터치 타깃 확대 */
  .nav-item { padding: 11px 12px; }
  .btn { padding: 9px 14px; }
  .btn-sm { padding: 7px 12px; font-size: 13px; }
  .seg-btn { padding: 9px 14px; }

  /* iOS 입력 포커스 줌 방지 (16px 미만이면 줌됨) */
  .input, .grid-body, .grid-score, textarea, input, select { font-size: 16px; }

  /* 넓은 표는 가로 스크롤 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table.list { min-width: 520px; }

  /* 모달 — 하단 시트 스타일 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
