:root {
  --bg: #f4f5f7;
  --panel: #fff;
  --line: #dfe3e8;
  --text: #1c2430;
  --muted: #6b7684;
  --accent: #1f4e8c;
  --accent-soft: #e8f0fb;
  --red: #c0392b;
  --red-bg: #fdecea;
  --orange: #c9700f;
  --orange-bg: #fdf3e3;
  --yellow: #8a6d00;
  --yellow-bg: #fbf6da;
  --gray: #5a6572;
  --gray-bg: #eef0f3;
  --green: #1e7a4d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Malgun Gothic", "맑은 고딕", -apple-system, system-ui, sans-serif;
}

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
code { background: #eceff3; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ---------- 상단 ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--accent); color: #fff;
}
.brandmark { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.brandmark .sub { font-size: 12px; font-weight: 400; opacity: .75; margin-left: 8px; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.today { opacity: .9; }
.badge-local {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  padding: 2px 8px; border-radius: 10px;
}
.badge-open { background: var(--red); border-color: var(--red); }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 2px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: none; padding: 11px 18px; color: var(--muted);
  border-bottom: 3px solid transparent; font-weight: 600;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.dot {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 11px;
  padding: 0 5px; margin-left: 4px; vertical-align: 1px;
}

main { padding: 18px; max-width: 1500px; margin: 0 auto; }
.tab { display: none; }
.tab.on { display: block; }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- 패널 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.panelhead {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panelhead h3 { margin: 0; font-size: 15px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 0 0 8px; }

/* ---------- 요약 카드 ---------- */
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
}
.card .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.card .t { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card.unassigned { border-left-color: #6b4fa0; } .card.unassigned .n { color: #6b4fa0; }
.card.overdue { border-left-color: var(--red); } .card.overdue .n { color: var(--red); }
.card.duesoon { border-left-color: var(--orange); } .card.duesoon .n { color: var(--orange); }
.card.stale   { border-left-color: var(--yellow); } .card.stale .n { color: var(--yellow); }
.card.nodue   { border-left-color: var(--gray); } .card.nodue .n { color: var(--gray); }
.card.report  { border-left-color: var(--green); } .card.report .n { color: var(--green); }
.card.open    { border-left-color: var(--accent); } .card.open .n { color: var(--accent); }

/* ---------- 표 ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #fafbfc; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #f7f9fc; }
td.num, th.num { text-align: right; }
.rowlink { cursor: pointer; }
.ttl { font-weight: 600; }
.sub2 { color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }

/* 경보 그룹 */
.group { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.group > h3 { margin: 0; padding: 10px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.group.unassigned > h3 { background: #f0ecf7; color: #6b4fa0; }
.group.overdue > h3 { background: var(--red-bg); color: var(--red); }
.group.duesoon > h3 { background: var(--orange-bg); color: var(--orange); }
.group.stale   > h3 { background: var(--yellow-bg); color: var(--yellow); }
.group.nodue   > h3 { background: var(--gray-bg); color: var(--gray); }
.group.report  > h3 { background: #e6f4ec; color: var(--green); }
.group h3 .cnt { font-weight: 400; opacity: .8; font-size: 12px; }
.group h3 .why { margin-left: auto; font-weight: 400; font-size: 12px; opacity: .8; }

/* 태그 */
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.tag.st-접수 { background: #eef0f3; color: #55606d; }
.tag.st-진행중 { background: var(--accent-soft); color: var(--accent); }
.tag.st-완료 { background: #e6f4ec; color: var(--green); }
.tag.st-보류 { background: #f0ecf7; color: #6b4fa0; }
.tag.st-취소 { background: #eceff3; color: #98a1ac; }
.tag.pr-긴급 { background: var(--red); color: #fff; }
.tag.pr-중요 { background: var(--orange-bg); color: var(--orange); border: 1px solid #eccfa2; }
.tag.pr-일반 { display: none; }
.tag.b-unassigned { background: #f0ecf7; color: #6b4fa0; }
.tag.b-overdue { background: var(--red-bg); color: var(--red); }
.tag.b-duesoon { background: var(--orange-bg); color: var(--orange); }
.tag.b-stale { background: var(--yellow-bg); color: var(--yellow); }
.tag.b-nodue { background: var(--gray-bg); color: var(--gray); }
.tag.b-report { background: #e6f4ec; color: var(--green); }
.tag.b-log { background: #eef2f6; color: #5a6b7d; }
.tag.b-ok, .tag.b-closed { background: #f2f4f7; color: var(--muted); }
.tag.cat { background: #eae6f5; color: #5b46a0; border: 1px solid #d6cdec; }

/* ---------- 사진 미리보기 · 썸네일 ---------- */
.photoprev { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.photochip { font-size: 12px; background: #eef2f6; border-radius: 6px; padding: 4px 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.thumb { position: relative; display: block; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumbdel {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 10px;
  border: 0; background: rgba(20,26,34,.6); color: #fff; font-size: 13px; line-height: 18px; cursor: pointer;
}
.thumbdel:hover { background: var(--red); }

/* ---------- 홈 행동 버튼 ---------- */
button.tiny.act-assign { background: #6b4fa0; color: #fff; border-color: #6b4fa0; }
button.tiny.act-report { background: var(--green); color: #fff; border-color: var(--green); }
button.tiny.act-nudge  { background: var(--orange); color: #fff; border-color: var(--orange); }
button.tiny.act-assign:hover, button.tiny.act-report:hover, button.tiny.act-nudge:hover { filter: brightness(1.1); }

/* ---------- 처리 단계 띠 (상세) ---------- */
.stagebar { display: flex; align-items: center; gap: 2px; margin-bottom: 12px; flex-wrap: wrap; }
.stagestep {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 4px 12px; border-radius: 14px; background: #eef0f3; white-space: nowrap;
}
.stagestep.done { background: var(--accent-soft); color: var(--accent); }
.stagestep.cur { background: var(--accent); color: #fff; }
.stagesep { flex: 0 0 14px; height: 2px; background: var(--line); }
.stagebar.cancelled { color: var(--muted); font-size: 13px; }
.stageact { margin-bottom: 14px; }
.stageact .wide { width: 100%; padding: 12px; font-size: 15px; }
.stageact .sub2 { margin-top: 5px; text-align: center; }
.stageact.done { text-align: center; padding: 8px; background: #e6f4ec; border-radius: 6px; }

/* ---------- 폼 ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px;
}
.rangelbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
input[type=text], input[type=search], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; font-family: inherit; }
#fq { min-width: 220px; }

button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 6px; padding: 7px 16px; font-weight: 600; }
button.primary:hover { filter: brightness(1.12); }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
button.ghost:hover { background: #f2f5f9; }
button.tiny { padding: 3px 9px; font-size: 12px; border-radius: 5px; background: #fff; border: 1px solid var(--line); }
button.tiny:hover { background: #f2f5f9; }
button.danger { color: var(--red); border-color: #e8c3bf; }

.formpanel { padding: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.formpanel label, .grid2 label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.formpanel label input, .formpanel label select, .formpanel label textarea,
.grid2 label input, .grid2 label select { width: 100%; margin-top: 4px; font-weight: 400; color: var(--text); }
label.full { margin-top: 12px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
label.inline input, label.inline select { width: auto; margin: 0; }
.formfoot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.formfoot .msg { font-size: 13px; }
.msg.ok { color: var(--green); } .msg.err { color: var(--red); }
.hint { background: var(--accent-soft); border-radius: 6px; padding: 10px 12px; font-size: 13px; margin: 0 0 12px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 7px 16px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--accent); color: #fff; }
.segwide { margin-bottom: 14px; }

.rowform { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rowform input, .rowform select { flex: 1; min-width: 110px; }

/* ---------- 상세 모달 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,26,34,.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modalbox { background: #fff; border-radius: 10px; width: min(880px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modalhead { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modalhead h3 { margin: 0; font-size: 16px; flex: 1; }
.modalbody { padding: 18px; overflow: auto; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; }
.orig { background: #f7f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 12px; white-space: pre-wrap; font-size: 13px; margin-bottom: 14px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.tl { margin-bottom: 12px; position: relative; }
.tl::before { content: ''; position: absolute; left: -20px; top: 6px; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }
.tl .when { font-size: 11px; color: var(--muted); }
.tl .what { font-size: 13px; }
.sechead { font-size: 12px; color: var(--muted); font-weight: 700; margin: 16px 0 8px; text-transform: none; }
.filelist a { color: var(--accent); }

/* ---------- 회의록 결과 표 ---------- */
.memotable input, .memotable select { width: 100%; }
.memotable td { padding: 5px 6px; }
.memotable .rm { color: var(--red); }

/* ---------- 보고서 ---------- */
.reportbody { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.rephead { text-align: center; margin-bottom: 18px; }
.rephead h2 { margin: 0 0 4px; font-size: 20px; }
.rephead .meta { color: var(--muted); font-size: 13px; }
.reportbody h4 { margin: 22px 0 8px; font-size: 14px; border-left: 3px solid var(--accent); padding-left: 8px; }
tfoot td { font-weight: 700; background: #fafbfc; }

/* ---------- 로그인 / 최초 설정 ---------- */
.gate {
  position: fixed; inset: 0; background: linear-gradient(160deg, #1f4e8c, #14335c);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.gatebox { background: #fff; border-radius: 12px; padding: 28px 26px; width: min(400px, 100%); }
.gatelogo { font-size: 20px; font-weight: 700; text-align: center; color: var(--accent); margin-bottom: 6px; }
.gatehint { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 18px; line-height: 1.6; }
.gateform label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.gateform input { width: 100%; margin-top: 4px; padding: 10px; font-weight: 400; color: var(--text); }
button.wide { width: 100%; padding: 11px; }
.gateform .msg { display: block; text-align: center; margin-top: 10px; font-size: 13px; }

.gatefoot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
.linkbtn {
  background: none; border: 0; color: var(--accent); font-weight: 600;
  text-decoration: underline; padding: 2px 4px; font-size: 12px;
}

.userbtn {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 3px 10px; border-radius: 10px; font-size: 12px;
}
.userbtn:hover { background: rgba(255,255,255,.28); }

/* 팀장에게만 보이는 영역 */
.adminonly { display: none; }
body.is-admin .adminonly { display: block; }
body.is-admin .cols.adminonly { display: grid; }

/* ---------- 데이터 안전 상태 ---------- */
.safetybody { padding: 6px 16px 14px; }
.safe { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.safe:last-child { border-bottom: 0; }
.safe .mark {
  flex: 0 0 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 10px; font-size: 12px; font-weight: 700; margin-top: 1px;
}
.safe.good .mark { background: #e6f4ec; color: var(--green); }
.safe.warn .mark { background: var(--orange-bg); color: var(--orange); }
.safe b { font-size: 13px; }

/* ---------- 빠른 받아적기 ---------- */
.fab {
  position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 28px;
  background: var(--accent); color: #fff; border: 0; font-size: 30px; line-height: 1;
  box-shadow: 0 4px 14px rgba(20,40,70,.35); z-index: 40;
}
.fab:hover { filter: brightness(1.12); }
.quickbox textarea { font-size: 16px; }   /* 16px 미만이면 iOS 가 화면을 확대해 버린다 */

.rowform.boxed { border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.scrollx { overflow-x: auto; }

/* ---------- 녹음 ---------- */
.rec { margin-bottom: 12px; }
.recbar { display: flex; align-items: center; gap: 12px; }
.recbtn {
  background: var(--red); color: #fff; border: 0; border-radius: 24px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; min-width: 140px;
}
.recbtn:hover { filter: brightness(1.1); }
.recbtn.on { background: #222; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(192,57,43,.18); } }
@media (prefers-reduced-motion: reduce) { .recbtn.on { animation: none; } }
.rectime { font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.recdone { margin-top: 12px; }
.recplay { width: 100%; max-width: 420px; display: block; margin-bottom: 8px; }
.recacts { display: flex; flex-wrap: wrap; gap: 8px; }

.recwarn {
  background: var(--orange-bg); border: 1px solid #eccfa2; border-radius: 6px;
  padding: 12px 14px; font-size: 13px;
}
.recwarn .sub2 { margin-top: 6px; line-height: 1.7; }
.cmd {
  background: #1c2430; color: #e6edf5; border-radius: 5px;
  padding: 8px 10px; margin: 6px 0; font-family: Consolas, monospace; font-size: 12px;
  overflow-x: auto; white-space: nowrap;
}

.ordiv { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 12px; }
.ordiv::before, .ordiv::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- 캘린더 ---------- */
.calbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px;
}
.caltitle { font-size: 17px; font-weight: 700; min-width: 120px; text-align: center; }
.callegend { display: flex; gap: 6px; align-items: center; }
.calgrid { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.calhead { display: grid; grid-template-columns: repeat(7, 1fr); background: #fafbfc; border-bottom: 1px solid var(--line); }
.calhd { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.calhd.sun { color: var(--red); } .calhd.sat { color: var(--accent); }
.calbody { display: grid; grid-template-columns: repeat(7, 1fr); }
.calcell {
  min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 4px 4px 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.calcell:nth-child(7n) { border-right: 0; }
.calcell.out { background: #fafbfc; }
.calcell.out .caldate { color: #c2c8d0; }
.calcell.today { background: var(--accent-soft); }
.caldate { font-size: 12px; font-weight: 700; color: var(--text); padding: 1px 3px; }
.caldate.sun { color: var(--red); } .caldate.sat { color: var(--accent); }
.calcell.today .caldate {
  background: var(--accent); color: #fff; border-radius: 10px;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
}
.calchip {
  font-size: 11px; line-height: 1.25; padding: 2px 5px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  border-left: 3px solid var(--muted); background: #f2f4f7; color: var(--text);
}
.calchip:hover { filter: brightness(.97); }
.calchip.b-log { background: #eef2f6; border-left-color: #8aa0b5; color: #5a6b7d; }
.calchip.b-unassigned { background: #f0ecf7; border-left-color: #6b4fa0; color: #6b4fa0; }
.calchip.b-report { background: #e6f4ec; border-left-color: var(--green); color: var(--green); }
.calchip.b-overdue { background: var(--red-bg); border-left-color: var(--red); color: var(--red); }
.calchip.b-duesoon { background: var(--orange-bg); border-left-color: var(--orange); color: var(--orange); }
.calchip.b-stale { background: var(--yellow-bg); border-left-color: var(--yellow); color: var(--yellow); }
.calchip.b-ok { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent); }
.calchip.b-closed { background: #eef0f3; border-left-color: #b7c0cc; color: var(--muted); text-decoration: line-through; }
.calmore { font-size: 11px; color: var(--muted); cursor: pointer; padding: 1px 5px; }
.calmore:hover { color: var(--accent); }

@media (max-width: 720px) {
  .calcell { min-height: 66px; padding: 3px 2px 4px; }
  .calchip { font-size: 9px; padding: 1px 3px; border-left-width: 2px; }
  .caldate { font-size: 11px; }
  .callegend { display: none; }
  .caltitle { min-width: 90px; font-size: 15px; }
}
@media print {
  .calbar { display: none; }
  .calcell { min-height: 96px; }
}

/* ---------- 받아쓰기 진행 ---------- */
.working {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); border-radius: 6px; padding: 12px 14px; margin-top: 10px;
  font-size: 13px;
}
.spin {
  flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px;
  border: 2px solid rgba(31,78,140,.25); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

@media print {
  .topbar, .tabs, .noprint, .filterbar { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .reportbody { border: 0; padding: 0; }
  table { font-size: 11px; }
  th, td { padding: 4px 6px; }
  tr { break-inside: avoid; }
  .fab, .userbtn { display: none !important; }
}

/* ==================== 폰 ==================== */
@media (max-width: 720px) {
  main { padding: 10px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .brandmark { font-size: 15px; }
  .brandmark .sub { display: none; }
  .topright { gap: 6px; font-size: 11px; }
  .today { display: none; }

  /* 탭이 잘리지 않고 옆으로 밀린다 */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 11px 12px; font-size: 13px; white-space: nowrap; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card .n { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .filterbar { gap: 6px; padding: 8px; }
  .filterbar > * { flex: 1 1 45%; min-width: 0; }
  #fq { flex-basis: 100%; min-width: 0; }
  .rangelbl { flex-basis: 100%; }
  .rowform { flex-direction: column; }
  .rowform input, .rowform select, .rowform button { width: 100%; }

  /* 폰에서 표를 그대로 두면 읽을 수 없다. 한 줄을 카드 하나로 접는다. */
  table.cardable thead { display: none; }
  table.cardable, table.cardable tbody, table.cardable tr, table.cardable td { display: block; width: 100%; }
  table.cardable tr {
    border: 1px solid var(--line); border-radius: 8px; margin: 8px; padding: 8px 10px;
  }
  table.cardable td { border: 0; padding: 2px 0; }
  table.cardable td[data-l="지시 내용"] { padding-bottom: 6px; }
  table.cardable td[data-l="번호"]::before,
  table.cardable td[data-l="지시일"]::before,
  table.cardable td[data-l="기한"]::before {
    content: attr(data-l) " "; color: var(--muted); font-size: 11px;
  }
  table.cardable td[data-l="번호"],
  table.cardable td[data-l="지시일"],
  table.cardable td[data-l="기한"] { display: inline-block; width: auto; margin-right: 12px; font-size: 12px; }

  .group > h3 .why { display: none; }
  .modal { padding: 0; align-items: stretch; }
  .modalbox { border-radius: 0; max-height: 100vh; height: 100%; }
  .kv { grid-template-columns: 72px 1fr; }
  .fab { right: 14px; bottom: 14px; }

  /* iOS 는 글자 크기가 16px 미만인 입력칸에 초점이 가면 화면을 확대한다 */
  input, select, textarea { font-size: 16px; }
}
