:root {
  --bg: #15171c; --panel: #1d2027; --card: #232730; --line: #343a46; --text: #e8eaee; --dim: #9aa3b2;
  --lime: #b5e86a; --amber: #f0b35a; --red: #f07a6a; --blue: #7fb6ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
button { font: inherit; font-size: 14px; color: var(--text); background: #2c313c; border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--dim); }
button.primary { background: #4a6b22; border-color: var(--lime); color: #fff; font-weight: 600; }
button.small { padding: 2px 8px; font-size: 14px; }
button.ghost { background: transparent; }
input, textarea { font: inherit; color: var(--text); background: #171a20; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; width: 100%; }
textarea { resize: vertical; min-height: 40px; line-height: 1.65; }
input:focus, textarea:focus { outline: none; border-color: var(--lime); }

#top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: #101216; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 17px; }
.brand span { color: var(--lime); font-weight: 600; margin-left: 6px; }
.status { color: var(--dim); font-size: 14px; flex: 1; min-width: 200px; }
.status.ok { color: var(--lime); } .status.bad { color: var(--red); } .status.busy { color: var(--amber); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

#wrap { display: flex; min-height: calc(100vh - 56px); }
#nav { width: 230px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto; }
#nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 7px; color: var(--text); text-decoration: none; margin-bottom: 2px; }
#nav a:hover { background: #262a33; }
#nav a.on { background: #2f3a24; color: var(--lime); font-weight: 600; }
#nav .sub { color: var(--dim); font-size: 14px; }
#nav .dot { font-size: 14px; color: var(--amber); }
#nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }
#main { flex: 1; padding: 20px 28px 120px; max-width: 1100px; }

h1 { font-size: 22px; margin: 0 0 4px; }
.hint { color: var(--dim); font-size: 14px; margin: 4px 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.card.changed { border-color: var(--amber); }
.cardHead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cardHead input.title { font-weight: 700; font-size: 16px; flex: 1; min-width: 220px; background: transparent; border-color: transparent; padding-left: 4px; }
.cardHead input.title:hover, .cardHead input.title:focus { border-color: var(--line); }
.badge { font-size: 14px; color: var(--blue); background: #1d2a3c; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.chg { font-size: 14px; color: var(--amber); }
.lbl { color: var(--dim); font-size: 14px; margin: 10px 0 4px; display: block; }
.row { display: flex; gap: 8px; align-items: flex-start; margin: 5px 0; }
.row .time { width: 76px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.row .who { width: 120px; flex: none; font-weight: 600; }
.row .min { width: 76px; flex: none; text-align: center; }
.row > span { white-space: nowrap; }
.row textarea { flex: 1; }
.row .tools { display: flex; flex-direction: column; gap: 4px; flex: none; }
.group { border-left: 3px solid #3c4a2a; padding-left: 12px; margin: 12px 0 18px; }
.group > input { font-weight: 700; width: 260px; margin-bottom: 6px; }
.meter { font-size: 14px; color: var(--dim); }
.meter b { color: var(--text); }
.roleHead { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.tag { display: inline-block; font-size: 14px; border-radius: 6px; padding: 1px 8px; margin-left: 8px; vertical-align: middle; }
.tag.culprit { background: #4a1f1c; color: var(--red); }
.tag.det { background: #1d2a3c; color: var(--blue); }
table.locks { width: 100%; border-collapse: collapse; }
table.locks td, table.locks th { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; font-size: 14px; }
table.locks th { color: var(--dim); font-weight: 600; }
.ok { color: var(--lime); } .warn { color: var(--amber); }

#modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: center; justify-content: center; }
#modal[hidden] { display: none; }
.sheet { background: var(--panel); width: min(900px, 94vw); height: 88vh; border-radius: 12px; display: flex; flex-direction: column; border: 1px solid var(--line); }
.sheetHead { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#modalBody { overflow: auto; padding: 18px 26px; white-space: pre-wrap; line-height: 1.75; }
#modalBody .h1 { font-size: 20px; font-weight: 800; color: var(--lime); }
#modalBody .h2 { font-size: 16px; font-weight: 700; color: var(--blue); }
#modalBody .q { color: #d9c9a0; }
#modalBody .code { font-family: ui-monospace, monospace; font-size: 14px; color: #c9d1dc; }

@media (max-width: 760px) {
  #wrap { flex-direction: column; }
  #nav { width: auto; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  #nav .sep { display: none; }
  #main { padding: 12px; }
  .roleHead { grid-template-columns: 1fr; }
  .row .who { width: 90px; }
}
