:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2129; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; font-size: 15px; }
[hidden] { display: none !important; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: #111827; color: #fff; }
.top h1 { font-size: 18px; margin: 0; }
#me-bar { display: flex; gap: 8px; align-items: center; }
#me-bar .ghost { color: #fff; border-color: #4b5563; }
main { max-width: 1100px; margin: 16px auto; padding: 0 16px; }
.card { background: var(--card); border-radius: 10px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.narrow { max-width: 380px; }
h2 { font-size: 16px; margin: 0 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 6px; }
button { padding: 9px 14px; font-size: 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
.email-row { display: flex; align-items: center; gap: 6px; }
.email-row input { margin-top: 4px; }
.email-row span { white-space: nowrap; color: var(--text); }
.hint { color: var(--muted); font-size: 13px; }
.msg { min-height: 1.2em; font-size: 13px; color: var(--muted); }
.msg.err { color: #dc2626; }

.state-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.state-buttons button { background: #fff; color: var(--text); border: 2px solid var(--line); }
.state-buttons button.on { border-color: currentColor; font-weight: 700; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.detail .wide { grid-column: 1 / -1; }
.detail button { grid-column: 1 / -1; justify-self: start; }

.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.board-head input { max-width: 220px; margin: 0 0 12px; }
.summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.summary .chip { cursor: pointer; }
.summary .chip.off { opacity: .35; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.memo { white-space: normal; min-width: 140px; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.me, tr.me td { background: #eff6ff; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--c, #6b7280); }
.ago { color: var(--muted); font-size: 12px; }
.late { color: #dc2626; font-weight: 600; }

dialog { border: none; border-radius: 10px; padding: 16px; width: min(360px, 92vw); }
.row { display: flex; gap: 8px; }

@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; }
  /* 휴대폰: 표 대신 카드형 */
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: none; padding: 2px 0; white-space: normal; }
  td[data-label]:not(:empty)::before { content: attr(data-label) " · "; color: var(--muted); font-size: 12px; }
  td.name { font-weight: 700; font-size: 16px; display: inline-block; width: auto; margin-right: 8px; }
  td.state { display: inline-block; width: auto; }
  .board-head { flex-direction: column; align-items: stretch; }
  .board-head input { max-width: none; }
}
