/* Black and white: ink #111 on white; gray for secondary; red only for failures. */
:root { --ink: #111; --sub: #6b6b6b; --line: #e6e6e6; --soft: #f2f3f5; --page: #fafafa; --bad: #c62828; }
body { font-family: system-ui, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif; margin: 0; color: var(--ink);
  background: var(--page); word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
header { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .75rem 1.5rem; background: #000; color: #fff; }
header .brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
header .badge { margin-left: .35rem; padding: .05rem .45rem; border: 1px solid #fff; border-radius: 999px; font-size: .72rem; font-weight: 600; vertical-align: 2px; }
header nav { display: flex; flex-wrap: wrap; gap: .2rem; }
header nav a { color: #b8b8b8; padding: .35rem .7rem; border-radius: 8px; text-decoration: none; }
header nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
header nav a.current { background: #fff; color: #000; font-weight: 600; }
header .who { margin-left: auto; color: #d0d0d0; }
nav.subnav { display: flex; flex-wrap: wrap; gap: .2rem; padding: 0 1.5rem; background: #fff; border-bottom: 1px solid var(--line); }
nav.subnav a { padding: .7rem .85rem; color: var(--sub); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.subnav a:hover { color: var(--ink); }
nav.subnav a.current { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
header .who b { color: #fff; }
.demo-mark { font-size: .75rem; padding: .1rem .5rem; border: 1px dashed #9a9a9a; border-radius: 4px; color: #d0d0d0; }
main { max-width: 1200px; margin: 1.5rem auto 4rem; padding: 0 1rem; }
h1 { font-size: 1.75rem; letter-spacing: -.02em; margin: 1.4rem 0 1rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.5rem; margin: 1.2rem 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.box > h2:first-child { margin-top: 0; }
form.inline { display: inline; margin: 0; }

/* Fields: filled gray, no border until focus (same family as the login page). */
label { display: block; margin: 0 0 1rem; font-size: .9rem; font-weight: 600; color: #444; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink); background: var(--soft); border: 1px solid transparent;
  border-radius: 10px; box-sizing: border-box; transition: border-color .15s, background .15s; }
input[type=text], input[type=password], input:not([type]), select { height: 2.75rem; padding: 0 .9rem; }
textarea { padding: .7rem .9rem; line-height: 1.5; resize: vertical; }
input:hover, textarea:hover, select:hover { background: #ebecef; }
input:focus, textarea:focus, select:focus { outline: none; background: #fff; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
label input, label textarea { display: block; margin-top: .45rem; width: 100%; max-width: 480px; }
label.inline-label { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
td input[type=text] { height: 2.1rem; padding: 0 .6rem; font-size: .92rem; border-radius: 8px; }
input[type=file] { font: inherit; font-size: .95rem; padding: .4rem .5rem; border: 1px dashed #c9c9c9; border-radius: 10px; background: #fff; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: .8rem; height: 2.1rem; padding: 0 .9rem;
  border: 0; border-radius: 8px; background: var(--ink); color: #fff; cursor: pointer; }
form.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin: 1rem 0 1.4rem; }
form.filters select { height: 2.4rem; }
form.upload { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

button { font: inherit; font-weight: 600; height: 2.75rem; padding: 0 1.2rem; border: 1px solid #000; border-radius: 10px;
  background: #000; color: #fff; cursor: pointer; transition: background .15s; }
button:hover { background: #333; }
button.small, form.filters button { height: 2.1rem; padding: 0 .85rem; font-size: .88rem; border-radius: 8px; }
form.filters button { height: 2.4rem; }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: #fdf2f2; }
header button { height: 2.1rem; padding: 0 .85rem; font-size: .88rem; background: transparent; border-color: #555; color: #fff; }
header button:hover { background: rgba(255, 255, 255, .12); }

/* Tables: one white card with a light header row. */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover { background: #fcfcfc; }
thead th { background: var(--soft); color: #333; font-size: .88rem; font-weight: 600; white-space: nowrap; }
table.facts { width: auto; }
td.actions form { margin-right: .3rem; }
tr.active { background: var(--soft); }
tr.failed td { color: var(--bad); }
tfoot th, tfoot td { border-top: 2px solid var(--ink); }
th.num, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
code { font-size: .9em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code.secret { font-size: 1.15rem; background: var(--soft); border: 1px solid #d4d4d4; padding: .2rem .5rem; border-radius: 6px; user-select: all; }
pre { background: #0b0b0b; color: #e8e8e8; padding: 1rem; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; }
pre.log { max-height: 36rem; overflow: auto; font-size: .82rem; }
table.trace { table-layout: fixed; }
table.trace th:nth-child(1) { width: 3.5rem; }
table.trace th:nth-child(2) { width: 10.5rem; }
table.trace th:nth-child(3) { width: 7rem; }
table.trace th:nth-child(4) { width: 11rem; }
table.trace th:nth-child(5) { width: 4rem; }
table.trace td { font-size: .9rem; overflow-wrap: anywhere; }
table.trace summary { cursor: pointer; }
table.trace pre { max-height: 40rem; overflow: auto; font-size: .82rem; overflow-wrap: anywhere; }

.tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; background: #ececec; color: var(--ink); white-space: nowrap; border: 1px solid transparent; }
.tag.good { background: #000; color: #fff; }
.tag.bad { background: #fff; color: var(--bad); border-color: var(--bad); }
.tag.wait { background: #fff; color: var(--sub); border-color: #cfcfcf; }
.tag.star { background: #000; color: #fff; font-weight: 700; }
.error { color: var(--bad); }
.ok { color: var(--ink); font-weight: 600; }
main > p.ok, main > p.error { background: #fff; border: 1px solid currentColor; border-radius: 10px; padding: .7rem 1rem; }
.hint { color: var(--sub); font-size: .92rem; font-weight: 400; }
.notice { background: #fff; border: 1px solid var(--ink); border-radius: 12px; padding: .9rem 1.1rem; }
.filters a.current { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ink); }
.small-text { font-size: .85rem; word-break: break-all; }
ul.errors li { color: var(--bad); margin: .25rem 0; }
ul.warnings li { color: #6b4e00; margin: .25rem 0; }
.scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
main a { color: var(--ink); text-underline-offset: 2px; }
main a:hover { text-decoration-thickness: 2px; }
.empty { background: #fff; border: 1px dashed #cfcfcf; border-radius: 12px; padding: 1.2rem; color: var(--sub); }
.total { font-size: 1.2rem; }
.facts-line { font-weight: 600; }
ol.flow { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; counter-reset: step; }
ol.flow li { flex: 1 1 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; color: var(--sub); counter-increment: step; }
ol.flow li b { display: block; color: var(--ink); }
ol.flow li b::before { content: counter(step) ". "; }

/* Round progress: a dot per step on a line (done = black, now = pulsing ring, fail = red, wait/skip = gray). */
.counts { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(0, 0, 0, .12); } }
table.flow td { vertical-align: middle; }
table.flow tr.failed-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
ol.stepper { display: flex; list-style: none; padding: 0; margin: .8rem 0 1.6rem; }
ol.stepper li { flex: 1 1 0; min-width: 0; position: relative; padding: 1.5rem .5rem 0 0; font-size: .85rem; color: #9a9a9a; }
ol.stepper li::before { content: ""; position: absolute; top: .38rem; left: 0; right: 0; height: 2px; background: #e3e3e3; }
ol.stepper li::after { content: ""; position: absolute; top: 0; left: 0; width: .85rem; height: .85rem; border-radius: 50%;
  border: 2px solid #cfcfcf; box-sizing: border-box; background: #fff; }
ol.stepper li b { display: block; font-weight: 600; }
ol.stepper li span { display: block; margin-top: .15rem; font-size: .8rem; }
ol.stepper li.done, ol.stepper li.now { color: var(--ink); }
ol.stepper li.done::before { background: #000; }
ol.stepper li.done::after { background: #000; border-color: #000; }
ol.stepper li.now::after { border-color: #000; animation: pulse 1.4s ease-in-out infinite; }
ol.stepper li.fail { color: var(--bad); }
ol.stepper li.fail::after { background: var(--bad); border-color: var(--bad); }
ol.stepper li.hidden::after { background: #9a9a9a; border-color: #9a9a9a; }
ol.stepper li.hidden::before { background: #9a9a9a; }
ol.stepper li.skip { opacity: .45; }
/* Admin round table: one flow line per team x problem, step names once in the header (same widths, so aligned). */
table.flow th.flowcol, table.flow td.flowcol { min-width: 38rem; width: 100%; padding-top: .45rem; padding-bottom: .45rem; }
ol.stepper.head, ol.stepper.row { margin: 0; }
ol.stepper.head li { padding: 0 .4rem 0 0; color: #333; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.stepper.head li::before, ol.stepper.head li::after { display: none; }
ol.stepper.row li { padding-top: 1.25rem; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ol.stepper.row li span { margin: 0; font-size: .8rem; }

/* Login: one column, larger fields and a full-width button. */
.auth { max-width: 400px; margin: 9vh auto 4rem; }
.auth h1 { margin: 0 0 .4rem; }
.auth .lead { color: var(--sub); margin: 0 0 2rem; line-height: 1.55; }
.auth label.field { margin-bottom: 1.1rem; }
.auth label.field input { max-width: none; height: 3.25rem; padding: 0 1rem; font-size: 1.05rem; border-radius: 12px; }
.auth input[type=password] { letter-spacing: .12em; }
.auth .error { margin: -.3rem 0 1rem; font-size: .92rem; }
button.wide { display: block; width: 100%; height: 3.25rem; margin-top: 1.6rem; font-size: 1.05rem; border-radius: 12px; }

@media (max-width: 700px) {
  header { padding: .6rem .8rem; }
  header .who { margin-left: 0; }
  main { margin: 1rem auto; padding: 0 .6rem; }
  th, td { padding: .45rem; }
  .scroll table { width: max-content; }  /* scroll the table sideways instead of squeezing every column */
  table.facts th, table.facts td { display: block; border: 0; padding: .15rem 0; }
  table.facts td { margin-bottom: .5rem; }
  table.facts code { overflow-wrap: anywhere; }  /* a full sha256 is wider than a phone screen */
  .auth { margin-top: 2rem; }
  nav.subnav { padding: 0 .8rem; }
  ol.stepper { flex-wrap: wrap; row-gap: 1rem; }
  ol.stepper li { flex: 1 1 33%; }
}
/* 관제 (admin monitor): full width, dense rows, one colour per meaning - red = broken, amber = look soon. */
:root { --warn: #8a5a00; --warn-soft: #fff6dc; --bad-soft: #fdf1f1; }
main.wide { max-width: none; padding: 0 1.2rem; margin-top: 1rem; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: #dcc27a; }
.mon-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.2rem; padding: .55rem 1.2rem; border-radius: 12px;
  border: 2px solid #000; background: #000; color: #fff; }
.mon-banner .mon-state { font-size: 2rem; letter-spacing: -.02em; line-height: 1.25; }
.mon-banner .mon-also { font-size: 1.15rem; font-weight: 600; }
.mon-banner .mon-facts { display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; margin-left: auto; font-size: .92rem; }
.mon-banner .mon-facts .mon-short b { text-decoration: underline; text-underline-offset: 3px; }
.mon-banner .mon-clock { font-size: .92rem; font-variant-numeric: tabular-nums; opacity: .85; }
.mon-banner.bad { background: var(--bad); border-color: var(--bad); }
.mon-banner.warn { background: var(--warn-soft); border-color: var(--warn); color: #3d2800; }
ul.mon-issues { list-style: none; padding: 0; margin: .5rem 0; }
ul.mon-issues li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; padding: .35rem .8rem; margin: .25rem 0;
  background: #fff; border: 1px solid var(--line); border-left: 6px solid #cfcfcf; border-radius: 8px; }
ul.mon-issues li.bad { border-left-color: var(--bad); background: var(--bad-soft); }
ul.mon-issues li.warn { border-left-color: var(--warn); background: var(--warn-soft); }
ul.mon-issues li.info { color: var(--sub); font-size: .9rem; padding: .25rem .8rem; }
ul.mon-issues .mon-what { flex: 1 1 20rem; }
ul.mon-issues .mon-age { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.mon-round { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem; margin: .5rem 0 0; padding: .45rem 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.mon-round .mon-round-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.mon-round .mon-left { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.mon-round .counts { margin: 0; }
.mon-round .counts .tag, .mon-round > .tag { font-size: .82rem; }
.mon-rounds { display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin-left: auto; font-size: .88rem; }
.mon-rounds a { text-decoration: none; color: var(--sub); border-bottom: 2px solid transparent; }
.mon-rounds a.current { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.mon-rounds i { display: inline-block; width: 7px; height: 7px; margin-left: .25rem; border-radius: 50%; border: 1px solid #9a9a9a; box-sizing: border-box; }
.mon-rounds i.good { background: #000; border-color: #000; }
.mon-rounds i.bad { background: var(--bad); border-color: var(--bad); }
.mon-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(44rem, 1fr)); gap: 0 1.2rem; align-items: start; }
.mon-group { min-width: 0; }
.mon-group h2 { margin: .7rem 0 .3rem; font-size: 1rem; }
.mon-group h2 .mon-only { float: right; font-size: .85rem; font-weight: 400; color: var(--sub); }
.mon-notes-title { margin: 1rem 0 .2rem; font-size: 1rem; }
table.mon { font-size: .84rem; }
table.mon th, table.mon td { padding: .2rem .45rem; vertical-align: middle; }
table.mon thead th { font-size: .78rem; }
table.mon tr.bad { background: var(--bad-soft); }
table.mon tr.bad td:first-child { box-shadow: inset 5px 0 0 var(--bad); font-weight: 700; }
table.mon tr.warn { background: var(--warn-soft); }
table.mon tr.warn td:first-child { box-shadow: inset 5px 0 0 var(--warn); font-weight: 700; }
table.mon tbody tr.bad:hover { background: #fbe6e6; }
table.mon tbody tr.warn:hover { background: #fdefc4; }
table.mon .mon-team { white-space: nowrap; }
table.mon .mon-name { display: inline-block; max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
table.mon .mon-id { display: inline-block; min-width: 1.7rem; color: var(--sub); font-weight: 400; font-variant-numeric: tabular-nums; }
table.mon .tag { font-size: .78rem; padding: 0 .4rem; }
table.mon a { text-decoration: none; }
table.mon a:hover { text-decoration: underline; }
table.mon .mon-quiet { color: var(--sub); }
table.mon tr.warn .mon-quiet, table.mon tr.bad .mon-quiet { color: var(--ink); font-weight: 700; }
.mon-step, .mon-detail { display: inline-block; white-space: nowrap; }
.mon-detail { font-size: .78rem; color: var(--sub); }
.mon-cell.wait { color: #9a9a9a; }
.mon-cell.bad, .mon-cell.bad a, .mon-cell.bad .mon-detail { color: var(--bad); font-weight: 700; }
.mon-cell.note .mon-detail { color: #5b3f8f; }   /* the team's own outcome (SLA failed, Agent error): not our red */
.mon-cell.flag-bad, .mon-cell.flag-bad a, .mon-cell.flag-bad .mon-detail { color: var(--bad); font-weight: 700; }
.mon-cell.flag-warn, .mon-cell.flag-warn a, .mon-cell.flag-warn .mon-detail { color: var(--warn); font-weight: 700; }
.dots { display: inline-flex; gap: 1px; margin-right: .35rem; vertical-align: -1px; }
.dots i { width: 6px; height: 9px; background: #e0e0e0; border-radius: 1px; box-sizing: border-box; }
.dots i.done { background: #000; }
.dots i.now { background: #fff; border: 2px solid #000; animation: pulse 1.4s ease-in-out infinite; }
.dots i.fail { background: var(--bad); }
.dots i.skip { background: #f0f0f0; }
.dots i.hidden { background: #9a9a9a; }

/* 현황 (team overview): two cards, then every round on one row. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0 1.2rem; }
.cards .box { margin: .6rem 0; }
.big { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: .2rem 0 .3rem; }
.big .tag { font-size: .85rem; font-weight: 600; vertical-align: 4px; }
table.plain { width: auto; border: 0; border-radius: 0; background: none; margin: .4rem 0; }
table.plain td { border: 0; padding: .2rem .9rem .2rem 0; vertical-align: middle; }
