:root {
  --bg: #16181d;
  --panel: #1f2229;
  --panel-2: #262a33;
  --line: #333845;
  --text: #ece8df;
  --muted: #a3a6ae;
  --accent: #e9c46a;
  --accent-ink: #1a1a1a;
  --red: #ef5b5b;
  --red-bg: #3a1f22;
  --amber: #f0a04b;
  --green: #5cc58a;
  --blue: #7aa7e8;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* .gate{display:grid} 같은 규칙이 hidden 을 덮지 않게 */
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
  word-break: keep-all; overflow-wrap: break-word;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { margin: 0; }
.nw { white-space: nowrap; }

/* 머리 */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.mark { width: 14px; height: 14px; background: var(--accent); box-shadow: 4px 4px 0 #8a6f2a; }
.who { display: flex; gap: 4px; background: var(--panel); padding: 3px; border-radius: 9px; }
.who button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.who button.on { background: var(--panel-2); color: var(--text); font-weight: 600; }
.rooms { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.room {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 8px; white-space: nowrap;
}
.room i { width: 8px; height: 8px; border-radius: 50%; background: #555; display: inline-block; }
.room.on i { background: var(--green); }
.room.off i { background: var(--red); }
.room.none i { background: #555; }

/* 숫자 4개 */
.counts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 16px 6px;
}
.count {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0;
}
.count b { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.count span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.count.hot b { color: var(--red); }
.c-answer.hot b { color: var(--accent); }
.count small { font-size: 14px; color: var(--muted); font-weight: 600; }

/* 탭(폰) */
.tabs { display: none; gap: 6px; padding: 8px 16px 0; }
.tabs button { flex: 1; border: 1px solid var(--line); background: var(--panel); padding: 9px; border-radius: 9px; color: var(--muted); }
.tabs button.on { color: var(--text); border-color: var(--accent); font-weight: 600; }

.layout { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 16px; padding: 10px 16px 24px; align-items: start; }

/* 오늘 판 */
.sec { margin-bottom: 18px; }
.sec h2 { font-size: 15px; font-weight: 700; margin: 4px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sec h2 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted); font-size: 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  scroll-margin-top: 140px;
}
.item.flash { outline: 2px solid var(--accent); }
.item.over { border-left: 4px solid var(--red); }
.item.wait { border-left: 4px solid var(--accent); }
.item.fail { border-left: 4px solid var(--red); background: var(--red-bg); }
.item.done { opacity: .62; }
.item .t { font-weight: 650; font-size: 15px; }
.item .t, .item .def, .item .meta > span { text-wrap: pretty; }  /* 마지막 줄 외톨이 막기 */
.item .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.item .meta .warn { color: var(--amber); }
.item .def { margin-top: 8px; font-size: 13.5px; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.item .def b { color: var(--accent); font-weight: 600; margin-right: 4px; }
.item .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); padding: 7px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap;
}
a.btn { display: inline-block; color: var(--text); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn:disabled { opacity: .5; cursor: default; }
.form { display: none; margin-top: 8px; gap: 6px; }
.form.open { display: flex; flex-wrap: wrap; }
.form input, .form textarea {
  flex: 1 1 200px; min-width: 0; background: #12141a; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.pend { margin-top: 8px; font-size: 13px; color: var(--blue); }
.err { margin-top: 8px; font-size: 13px; color: var(--red); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* 사무실 */
.office { min-width: 0; }
.office-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.office-switch { display: flex; gap: 4px; background: var(--panel); padding: 3px; border-radius: 9px; }
.office-switch button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.office-switch button.on { background: var(--panel-2); color: var(--text); font-weight: 600; }
.office-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.office-tools button { border: 1px solid var(--line); background: var(--panel); padding: 6px 11px; border-radius: 8px; white-space: nowrap; }
.office-tools button.primary { border-color: var(--accent); }
.office-tools button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.stage-wrap {
  position: relative; overflow: auto; height: calc(100vh - 230px); min-height: 360px;
  display: grid; place-items: safe center;   /* 사무실 그림을 칸 한가운데에 — 확대해 넘치면 왼쪽 위부터 스크롤 */
  background: #0e0f13; border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y;
}
.stage-wrap.editing { touch-action: none; }
#stage { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.stage-box { position: relative; }   /* 불 꺼짐 막은 스크롤 상자 밖에서 보이는 칸 전체를 덮는다 */
.lights-off {
  position: absolute; inset: 0; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(6, 7, 10, .62); pointer-events: none; text-align: center; padding: 16px;
}
.lights-off b { font-size: 22px; letter-spacing: .02em; }
.lights-off span { color: var(--muted); font-size: 13px; word-break: keep-all; text-wrap: balance; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 2px 0; }

/* 꾸미기 도구 */
.editor { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ed-row:last-child { margin-bottom: 0; }
.ed-row > label { font-size: 12.5px; color: var(--muted); min-width: 52px; white-space: nowrap; }
.tool { border: 1px solid var(--line); background: var(--panel-2); padding: 6px 10px; border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
.tool.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.swatch { width: 30px; height: 30px; border-radius: 6px; border: 2px solid transparent; padding: 0; image-rendering: pixelated; background-size: cover; }
.swatch.on { border-color: var(--accent); }
.palette { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
.piece { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 4px; }
.piece canvas { image-rendering: pixelated; }
.piece span { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.25; }
.piece.on { border-color: var(--accent); }
.staff-list { display: flex; gap: 6px; flex-wrap: wrap; }
.staff-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 3px 8px 3px 3px; font-size: 13.5px; white-space: nowrap; touch-action: none; }
.staff-chip canvas { image-rendering: pixelated; background: #12141a; border-radius: 5px; }
.staff-chip.on { border-color: var(--accent); }
.staff-chip.placed { opacity: .75; }
.saved-note { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.saved-note.dirty { color: var(--amber); }

/* 업무 카드(캐릭터 누르면) */
dialog#card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
  width: min(440px, calc(100vw - 32px)); padding: 16px;
}
dialog#card::backdrop { background: rgba(0, 0, 0, .55); }
.card-head { display: flex; gap: 12px; align-items: center; }
.card-head canvas { image-rendering: pixelated; background: #12141a; border-radius: 8px; }
.card-head h3 { margin: 0; font-size: 17px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
dialog#card .seg { white-space: nowrap; }
dialog#card p, dialog#card .card-sec > div { word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }
.card-sec { margin-top: 12px; }
.card-sec h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card-sec ol { margin: 0; padding-left: 18px; font-size: 13.5px; }
.card-sec ol li span { color: var(--muted); font-size: 12px; margin-left: 4px; }
.card-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.card-sec input, .card-sec select { background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; }

.gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.gate-box { max-width: 360px; text-align: center; }
.gate-box h2 { font-size: 19px; margin-bottom: 6px; }
.gate-box p { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #2c303a; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; }
.toast.bad { border-color: var(--red); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 16px 20px; color: #6f737c; font-size: 12px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .tabs { display: flex; }
  body[data-tab="board"] .office { display: none; }
  body[data-tab="office"] .board { display: none; }
  .stage-wrap { height: auto; min-height: 260px; max-height: calc(100vh - 270px); display: block; }
  .stage-wrap.overview { min-height: 0; }   /* 폰 첫 화면(건물 전체 폭): 그림 높이만큼만 */
}
@media (max-width: 420px) {
  .counts { gap: 6px; padding: 12px 16px 4px; }
  .count { padding: 8px 9px; }
  .count b { font-size: 25px; }
  .count span { font-size: 12px; }
  .brand h1 { font-size: 16px; }
}
@media (max-width: 340px) {
  .counts { grid-template-columns: repeat(2, 1fr); }
}

/* 화면 안 알림 — 본부 화면을 보고 있으면 텔레그램 대신 여기로 온다 */
.notice-stack { position: fixed; bottom: 20px; left: 16px; z-index: 40; width: min(368px, calc(38vw - 40px)); min-width: 288px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.notice { pointer-events: auto; background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); animation: notice-in .25s ease-out; }
.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.notice-head b { color: var(--accent); font-size: 13px; }
.notice-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; }
.notice-t { font-weight: 650; text-wrap: pretty; }
.notice-d { color: var(--muted); font-size: 13px; margin-top: 4px; text-wrap: pretty; }
.notice-d span { color: var(--text); }
.notice .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.notice-perm { display: block; margin-top: 8px; background: none; border: 0; padding: 0; color: var(--blue); font-size: 12px; text-decoration: underline; text-align: left; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 860px) { .notice-stack { bottom: auto; top: 64px; left: 16px; right: 16px; width: auto; min-width: 0; } }

/* 직원 배치: 담당·찾을 낱말 입력 */
.ed-input { background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; width: 12em; max-width: 100%; }

/* 결과물 창 (벽 TV를 누르면) */
dialog#results, dialog#job-dlg {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
  width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 16px 18px 18px; overflow: auto;
}
dialog#results::backdrop, dialog#job-dlg::backdrop { background: rgba(0, 0, 0, .55); }
.res-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.res-head h3 { margin: 0; font-size: 18px; word-break: keep-all; }
.res-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; word-break: keep-all; text-wrap: pretty; }
.res-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.res-days button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.res-days button.on { border-color: var(--accent); color: var(--text); font-weight: 650; }
.res-days button b { color: #5fd08f; margin-left: 2px; }
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res-job { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--text); }
.res-job:hover { border-color: #4a5060; }
.res-job.new { border-left: 4px solid #5fd08f; }
.res-f canvas { display: block; image-rendering: pixelated; background: #12141a; border-radius: 6px; }
.res-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.res-tag { align-self: flex-start; font-size: 12px; font-weight: 650; color: #f3dfa8; border: 1px solid rgba(233,196,106,.6); border-radius: 5px; padding: 0 6px; white-space: nowrap; }
.res-title { font-weight: 650; font-size: 14.5px; word-break: keep-all; overflow-wrap: break-word; text-wrap: balance; }
.res-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.res-meta span { white-space: nowrap; }
.res-new { flex: none; font-size: 12px; font-weight: 700; color: #0f2a1d; background: #5fd08f; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.res-seen { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.res-jobhead { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.res-round { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; }
.res-round.new { border-left: 4px solid #5fd08f; }
.res-rh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.res-rh b { font-size: 13.5px; }
.res-report { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }
.res-report .muted, .res-none { color: var(--muted); font-size: 13px; }
.res-none { margin-top: 8px; }
.res-report .pth { display: inline-block; max-width: 100%; overflow-x: auto; white-space: nowrap; vertical-align: bottom; scrollbar-width: thin; color: var(--muted); }
.res-out { margin-top: 10px; }
.res-out h5 { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.res-o { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 6px 0; border-top: 1px dashed #343946; }
.res-o:first-of-type { border-top: 0; }
.res-name { font-weight: 600; font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-path { grid-column: 1 / -1; min-width: 0; font-size: 12px; color: #8b8f98; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-demo { font-size: 12px; color: var(--muted); white-space: nowrap; }
.res-demo-note { margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; background: var(--panel-2, rgba(127,127,127,.12)); color: var(--muted); word-break: keep-all; text-wrap: balance; }
.res-head h3 .res-tag { vertical-align: 2px; margin-left: 4px; font-size: 13px; }
.res-o .btn { padding: 4px 10px; font-size: 13px; text-decoration: none; color: var(--text); }
.res-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); word-break: keep-all; text-wrap: pretty; }
@media (max-width: 520px) {
  dialog#results { padding: 14px; }
  .res-job { align-items: flex-start; flex-wrap: wrap; row-gap: 6px; }
  .res-job .res-main { flex: 1 1 calc(100% - 56px); }
  .res-job .res-new, .res-job .res-seen { margin-left: 44px; }
  .res-o { grid-template-columns: 1fr; }
  .res-o .btn, .res-o .res-demo { justify-self: start; }
}

/* 2차: 코덱스·제미나이 · 보조 직원 카드 */
.card-sec .row { display: flex; flex-wrap: wrap; gap: 6px; }
.eng-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); word-break: keep-all; text-wrap: pretty; }
.eng-real { font-size: 14px; font-weight: 600; }
.eng-h4 { margin-top: 12px !important; }
.eng-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.eng-run { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.eng-h { font-size: 12.5px; color: var(--muted); }
.eng-h .seg { white-space: nowrap; }
.eng-ans { font-size: 13.5px; margin-top: 2px; word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; white-space: pre-line; }
.eng-sim { display: inline-block; font-size: 11px; color: var(--accent); border: 1px solid rgba(233,196,106,.5); border-radius: 4px; padding: 0 5px; margin-right: 5px; vertical-align: 1px; white-space: nowrap; }
.eng-wait { font-size: 13px; margin-top: 2px; color: #8fe0d6; }
.eng-fail { font-size: 13px; margin-top: 2px; color: var(--red); }
.muted-s { color: var(--muted); font-size: 13px; }
.ed-select { width: auto; }

/* 2차: 방 표지판 고치기 창 */
dialog#room-dlg {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
  width: min(360px, calc(100vw - 32px)); padding: 16px;
}
dialog#room-dlg::backdrop { background: rgba(0, 0, 0, .55); }
#room-dlg h3 { margin: 0; font-size: 17px; }
.room-now { margin: 3px 0 10px; color: var(--muted); font-size: 13px; word-break: keep-all; text-wrap: pretty; }
.room-f { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.room-f label { width: 52px; flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.room-f input, .room-f select { flex: 1; min-width: 0; background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
.room-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); word-break: keep-all; text-wrap: pretty; }
.btn.danger { border-color: #5a2c2f; color: #f3b1b1; margin-right: auto; }
/* 직원이 29명이 되니 명단이 사무실을 화면 밖으로 밀어냄 → 명단은 두 줄 높이에서 스크롤 */
.staff-list { max-height: 76px; overflow-y: auto; flex: 1 1 300px; min-width: 0; padding-right: 2px; }

/* 사용량 띠 — 머리의 사무실 상태 줄 오른쪽(줄 높이를 늘리지 않는다) */
.room.use { gap: 2px 8px; padding-left: 10px; flex-wrap: wrap; max-width: 100%; }
.room.use b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.use-w.hot b { color: var(--amber); }
.use-w, .use-at { white-space: nowrap; }
.use-at { color: #7d818a; }
@media (min-width: 861px) { .room.use { margin-left: auto; } .room.use ~ .room.use { margin-left: 0; } }
@media (max-width: 860px) { .room.use { width: fit-content; border-radius: 12px; } }

/* 작업 보드 */
.job-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-bottom: 8px; }
.job-cols button { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 6px 0 7px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.job-cols b { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.job-cols span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.job-cols button.on { border-color: var(--accent); background: var(--panel-2); }
.job-cols button.on span { color: var(--text); }
.job-cols .j-review.n b { color: var(--accent); }
.job-cols .j-failed.n b { color: var(--red); }
.job-cols button.chk b { color: var(--amber); }
.job-cols button.chk { border-color: #7a5526; }
.job-cols button.on { border-color: var(--accent); }
#sec-jobs { scroll-margin-top: 110px; }
.item.job.c-review { border-left: 4px solid var(--accent); }
.item.job.c-failed { border-left: 4px solid var(--red); background: var(--red-bg); }
.item.job.c-done, .item.job.c-dropped { opacity: .75; }
.item.job.chk { border-left: 4px solid var(--amber); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: 999px; background: #4a3a17; color: #f2cf78; white-space: nowrap; }
.badge.b-doing { background: #1f3d2e; color: #7fe0ab; }
.badge.b-failed { background: #5a2c2f; color: #f3b1b1; }
.badge.b-todo { background: #2b2f38; color: var(--muted); }
.job-last { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; font-size: 13.5px; background: var(--panel-2); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.job-last span { flex: none; color: var(--muted); font-size: 12.5px; }
.item.job { min-width: 0; }
.job-last b { display: block; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; }
.job-last b.wrap { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.job-last.one { margin: 6px 0 8px; }
.job-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 8px; font-size: 13px; }
.job-state .warn { color: var(--amber); }
.job-state span:not(.badge) { text-wrap: pretty; }
.item .meta > span.badge, .item .meta > span.tag { text-wrap: nowrap; }
.item .meta > span.tag { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.btn.more { width: 100%; }
#sec-jobs .row .btn { min-height: 38px; }

/* 결과물 미리보기 */
#job-dlg .seg { white-space: nowrap; }
.pv-img, .pv-vid { display: block; max-width: 100%; max-height: 62vh; margin: 6px auto 8px; border-radius: 8px; background: #0e0f13; }
.pv-yt { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; margin: 6px 0 8px; background: #0e0f13; }
.pv-rep { margin-top: 10px; }
.pv-rep summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }

/* 폰 사무실: 방 단추 · 방 하나 크게 · 명단 */
.ph-top, .ph-chips, .ph-list { display: none; }
@media (max-width: 860px) {
  body.ph.of .counts, body.ph.of .office-head, body.ph.of #office-hint, body.ph.of .top .rooms, body.ph.of .foot, body.ph.of .who { display: none; }
  body.ph .office-tools { display: none; }              /* 꾸미기·직원 배치는 PC 에서만 */
  body.ph.of .stage-wrap { max-height: none; overflow: hidden; min-height: 0; border-radius: 12px; touch-action: pan-y; }
  body.ph.of .ph-top { display: flex; gap: 6px; margin-left: auto; }
  .ph-top button { min-height: 44px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
  body.ph.of .ph-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
  body.ph.of .ph-chips:empty { display: none; }
  .ph-chips button { min-height: 54px; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; line-height: 1.15; }
  .ph-chips b { font-size: 15px; font-weight: 700; }
  .ph-chips small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .ph-chips small.w { color: #7fe0ab; }
  .ph-chips button.on { background: var(--accent); border-color: var(--accent); color: #241a05; }
  .ph-chips .on small, .ph-chips .on small.w { color: #4d3b10; }
  body.ph.of .ph-list { display: block; }
  .ph-h { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; font-size: 18px; font-weight: 750; }
  .ph-h small { font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .ph-row { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 64px; padding: 9px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
  .ph-row canvas { width: 32px; height: 48px; flex: none; image-rendering: pixelated; }
  .ph-row .b { flex: 1; min-width: 0; display: block; }
  .ph-row .n, .ph-row .w { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ph-row .n { font-size: 15.5px; font-weight: 700; }
  .ph-row .w { font-size: 14px; color: var(--muted); margin-top: 3px; }
  .ph-row .s { flex: none; font-size: 13px; font-weight: 700; padding: 5px 9px; border-radius: 999px; background: #2b2f38; color: var(--muted); white-space: nowrap; }
  .ph-row.busy { border-color: #3d6b53; }
  .ph-row.busy .s { background: #1f3d2e; color: #7fe0ab; }
  .ph-row.rep .s { background: #4a3a17; color: #f2cf78; }
  .ph-row.fail .s { background: #5a2c2f; color: #f3b1b1; }
  .ph-row.quiet .s { display: none; }
  .ph-row.quiet canvas { opacity: .75; }
  .ph-idle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ph-idle .ph-row { min-height: 60px; margin: 0; padding: 6px 10px; }
  body.ph dialog#card, body.ph dialog#job-dlg { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 82vh; border-radius: 20px 20px 0 0; border-bottom: 0; padding: 12px 16px calc(22px + env(safe-area-inset-bottom)); overflow: auto; }
  body.ph dialog#card::before, body.ph dialog#job-dlg::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #4a505e; margin: 0 auto 12px; }
  body.ph dialog#card .btn, body.ph dialog#job-dlg .btn { min-height: 46px; }
  body.ph .card-foot { flex-wrap: wrap; }
  body.ph dialog#job-dlg a.btn { display: inline-flex; align-items: center; }
  body.ph dialog#job-dlg .res-o { grid-template-columns: 1fr auto; }
}
@media (max-width: 360px) {
  .job-cols { gap: 4px; }
  .job-cols span { font-size: 11.5px; letter-spacing: -.03em; }
  .ph-top button { padding: 0 9px; font-size: 14px; }
}

/* ── 층 보기(건물) ── */
.fl-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.fl-bar button { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); white-space: nowrap; font-size: 14px; }
.fl-bar button b { font-size: 15px; }
.fl-bar button:disabled { color: var(--muted); cursor: default; }
.fl-bar .ask { border-color: var(--accent); }
.fl-bar .ask b { color: var(--accent); }
.fl-bar .fail { border-color: var(--red); background: var(--red-bg); }
.fl-bar .un { border-color: var(--blue); }
.fl-bar .un b { color: var(--blue); }
.fl-main { min-width: 0; }
body.fl .fl-main { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 10px; align-items: start; }
.fl-list { display: grid; gap: 6px; }
.fl-list button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 58px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; }
.fl-list button.on { border-color: var(--accent); background: var(--panel-2); }
.fl-list .no { flex: none; width: 24px; font-weight: 750; font-size: 14px; color: var(--muted); }
.fl-list .on .no { color: var(--accent); }
.fl-list .b { flex: 1; min-width: 0; line-height: 1.25; }
.fl-list .n { display: block; font-size: 13px; font-weight: 650; text-wrap: balance; }
.fl-list small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; margin-top: 2px; }
.fl-list small.w { color: #7fe0ab; }
.fl-list small.l { color: #f2cf78; }
.fl-list .fs { flex: none; display: flex; }
.fl-list .fs canvas { image-rendering: pixelated; width: 16px; height: 24px; }
.fl-list .fs canvas + canvas { margin-left: -3px; }
@media (min-width: 861px) { body.fl .stage-wrap { height: calc(100vh - 300px); min-height: 400px; } }
.fl-roster { margin-top: 12px; }
.fl-desc { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; text-wrap: pretty; }
.fl-roster .ph-h, .ph-list .ph-h { text-wrap: balance; }
.fl-roster .ph-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font-size: 15px; font-weight: 700; }
.fl-roster .ph-h small { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.fl-roster .fl-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.fl-roster .ph-row { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 54px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; }
.fl-roster .ph-row canvas { width: 28px; height: 42px; flex: none; image-rendering: pixelated; }
.fl-roster .ph-row .b { flex: 1; min-width: 0; display: block; }
.fl-roster .ph-row .n, .fl-roster .ph-row .w { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-roster .ph-row .n { font-size: 14px; font-weight: 650; }
.fl-roster .ph-row .w { font-size: 12.5px; color: var(--muted); }
.fl-roster .ph-row .s { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #2b2f38; color: var(--muted); white-space: nowrap; }
.fl-roster .ph-row.busy .s { background: #1f3d2e; color: #7fe0ab; }
.fl-roster .ph-row.rep .s { background: #4a3a17; color: #f2cf78; }
.fl-roster .ph-row.fail .s { background: #5a2c2f; color: #f3b1b1; }
.fl-roster .ph-row.quiet canvas { opacity: .75; }
.ph-row.lead { border-color: #7a6431 !important; }
body.ph .ph-row.lead .s { display: inline !important; }
.lead-tag { font-style: normal; font-size: 12px; font-weight: 700; background: var(--accent); color: #241a05; border-radius: 5px; padding: 1px 6px; margin-right: 6px; white-space: nowrap; }
.card-head h3 .lead-tag { font-size: 13px; vertical-align: 2px; }
/* 팀 판 */
.fl-ns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fl-n { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.fl-n b { font-size: 20px; line-height: 1.2; }
.fl-n span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fl-n.review { border-color: var(--accent); }
.fl-n.failed { border-color: var(--red); }
.fl-n:disabled { cursor: default; opacity: .7; }
.fl-team p, .fl-win-set p { margin: 6px 0; }
.fl-mem { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fl-m { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); font-size: 13px; white-space: nowrap; max-width: 100%; }
.fl-m span { overflow: hidden; text-overflow: ellipsis; }
.fl-m small { color: var(--muted); font-size: 12px; }
.fl-last { margin-top: 12px; }
.fl-rep { font-size: 13.5px; white-space: pre-wrap; max-height: 9.5em; overflow: auto; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.fl-team + .fl-team { border-top: 1px solid var(--line); padding-top: 10px; }
.fl-rows { display: grid; gap: 6px; margin: 8px 0; }
.fl-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); text-align: left; }
.fl-row .b { flex: 1; min-width: 0; display: block; }
.fl-row .n { display: block; font-size: 14px; font-weight: 600; text-wrap: pretty; }
.fl-row .w { display: block; font-size: 12.5px; color: var(--muted); }
.fl-row .s { flex: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fl-win { display: flex; gap: 6px; align-items: center; }
.fl-win .fl-row { flex: 1; min-width: 0; }
.fl-win select { flex: none; max-width: 42%; background: #12141a; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; font-size: 14px; }
.fl-max { margin: -4px 0 8px 62px; color: #f3b1b1; font-size: 12.5px; white-space: nowrap !important; }
.room-f small { white-space: nowrap; }
.fl-win-set .room-f { margin-bottom: 6px; }
/* 층 이름·배치 */
dialog#fl-dlg { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: 86vh; padding: 16px; overflow: auto; }
dialog#fl-dlg::backdrop { background: rgba(0, 0, 0, .55); }
dialog#fl-dlg h3 { margin: 0 0 10px; font-size: 17px; }
dialog#fl-dlg h3 small { font-size: 13px; font-weight: 500; color: var(--muted); }
dialog#fl-dlg p { text-wrap: pretty; }
dialog#fl-dlg .room-f label { width: 62px; }
.fl-chips, .fl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fl-tabs .tool, .fl-chips .tool { white-space: nowrap; }
.fx-room { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.fx-order, .fx-spots { display: grid; gap: 6px; }
.fx-of { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fx-of b { width: 28px; }
.fx-of > span { flex: 1; min-width: 120px; text-wrap: balance; }
.fx-mv { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px 36px; }
.fx-mv .tool { font-size: 13px; white-space: nowrap; }
.fx-spots { background: var(--panel-2); border-radius: 9px; padding: 10px; margin: 0 0 8px 36px; }
.fx-spots small { color: var(--muted); white-space: nowrap; }
.fx-flat { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* 폰 */
@media (max-width: 860px) {
  body.fl .fl-main { display: block; }
  body.ph .fl-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  body.ph .fl-bar[hidden] { display: none; }
  body.ph .fl-bar button { justify-content: center; min-height: 44px; padding: 6px 4px; gap: 6px; }
  body.ph.of.fl-all .stage-box { display: none; }
  .fl-floor { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
  .fl-floor.busy { border-color: #3d6b53; }
  .fl-floor .no { flex: none; width: 30px; font-size: 17px; font-weight: 750; color: var(--accent); }
  .fl-floor .fs { flex: none; display: flex; }
  .fl-floor .fs canvas { width: 24px; height: 36px; image-rendering: pixelated; }
  .fl-floor .fs canvas + canvas { margin-left: -4px; }
  .fl-floor .b { flex: 1; min-width: 0; }
  .fl-floor .n { display: block; font-size: 15px; font-weight: 700; text-wrap: balance; line-height: 1.3; }
  .fl-floor .w { display: block; font-size: 13px; color: var(--muted); text-wrap: balance; line-height: 1.35; margin-top: 2px; }
  .fl-floor .s { flex: none; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--muted); }
  .fl-floor.busy .s { color: #7fe0ab; }
  .fl-floor.look .s { color: #f2cf78; }
  .fl-fixbtn { width: 100%; min-height: 46px; margin-top: 6px; }
  .fl-fh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
  .fl-fh b { font-size: 18px; text-wrap: balance; }
  .fl-fh .btn { min-height: 44px; white-space: nowrap; }
  body.ph .fl-people { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  body.ph .fl-n { min-height: 56px; }
  body.ph .fl-m, body.ph .fl-row { min-height: 44px; }
  body.ph dialog#fl-dlg { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  body.ph dialog#fl-dlg .btn, body.ph dialog#fl-dlg .tool { min-height: 44px; }
  body.ph dialog#fl-dlg input, body.ph dialog#fl-dlg select, body.ph dialog#card input, body.ph dialog#card select { min-height: 44px; font-size: 16px; }
  .fl-win { flex-wrap: wrap; }
  .fl-win .fl-row { flex-basis: 100%; }
  .fl-win select { max-width: 100%; width: 100%; }
}
@media (max-width: 360px) {
  .fl-n span { font-size: 11.5px; letter-spacing: -.03em; }
  .fl-floor { gap: 7px; padding: 8px; }
  .fl-floor .fs canvas:nth-child(n+3) { display: none; }
}

/* 11/25 2차 — 단추는 얇게, 폰은 사무실 그림을 크게 */
.fl-here, .fl-rail, .fl-wide { display: none; }
@media (min-width: 861px) {
  .counts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 2px; }
  .count { flex-direction: row; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 9px; }
  .count span { order: -1; }
  .count b { font-size: 19px; }
  .job-cols button { min-height: 42px; padding: 4px 0 5px; }
  .job-cols b { font-size: 16px; }
  .fl-bar button { padding: 4px 10px; font-size: 13px; }
  .fl-bar button b { font-size: 14px; }
  .office-tools button { padding: 5px 10px; font-size: 14px; }
  .fl-list button { min-height: 46px; padding: 4px 8px; }
  body.fl .stage-wrap { height: calc(100vh - 222px); }
  body.fl .fl-main { grid-template-columns: 190px minmax(0, 1fr); }
  .fl-bar { margin: 0 auto 0 4px; align-items: center; }
  .fl-bar button:disabled { display: none; }
}
@media (max-width: 860px) {
  /* 머리 한 줄: 화면 고르기(왼쪽) + 작은 단추(오른쪽) */
  body.ph .top { padding: 7px 12px; min-height: 50px; gap: 6px 8px; }
  body.ph .brand h1 { display: none; }
  body.ph .tabs { position: fixed; top: 7px; left: 38px; z-index: 21; padding: 0; gap: 2px; }
  body.ph .tabs button { flex: none; min-height: 36px; padding: 0 11px; border: 0; background: none; font-size: 15px; white-space: nowrap; }
  body.ph .tabs button.on { background: var(--panel-2); color: var(--text); font-weight: 700; }
  body.ph .brand { min-height: 36px; }
  body.ph.of .ph-top { gap: 2px; }
  body.ph .ph-top button { min-height: 36px; padding: 0 9px; border: 0; background: none; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
  body.ph[data-tab="board"] .who { margin-left: auto; }
  body.ph .who button { padding: 5px 8px; font-size: 13.5px; }
  body.ph .counts { padding: 8px 12px 2px; gap: 6px; }
  body.ph .count { padding: 5px 9px 6px; }
  body.ph .count b { font-size: 19px; }
  body.ph .count span { font-size: 12px; }
  body.ph .layout { padding-top: 6px; }

  /* 층 보기 */
  body.ph.of.fl .layout { padding: 0 0 24px; }
  body.ph.of.fl .stage-box { overflow: hidden; }
  body.ph.of.fl .stage-wrap { border-radius: 0; border-left: 0; border-right: 0; touch-action: pan-x pan-y; place-items: start; scrollbar-width: none; }
  body.ph.of.fl .stage-wrap::-webkit-scrollbar { display: none; }
  body.ph.of.fl .stage-wrap.fill { overflow-x: auto; overflow-y: hidden; display: block; }
  body.ph.of.fl .stage-wrap.fill #stage { margin-right: 54px; }
  body.ph.of.fl .stage-wrap:not(.fill) { min-height: 360px; display: grid; align-items: center; }
  body.ph.of.fl .fl-rail { display: flex; flex-direction: column; position: absolute; right: 6px; top: 50%; transform: translateY(calc(-50% - 8px)); z-index: 3; border-radius: 12px; background: rgba(22, 24, 29, .9); border: 1px solid var(--line); overflow: hidden; }
  .fl-rail button { position: relative; width: 44px; height: 40px; border: 0; background: none; padding: 0; color: var(--muted); }
  .fl-rail button + button { border-top: 1px solid #2a2e37; }
  .fl-rail b { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 700; }
  .fl-rail button:has(i) b { right: 17px; }
  .fl-rail button.on { background: var(--accent); color: #241a05; }
  .fl-rail i { position: absolute; top: 50%; right: 4px; margin-top: -7.5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; font: 700 10px/15px inherit; font-style: normal; font-size: 10px; line-height: 15px; text-align: center; background: #f2cf78; color: #241a05; }
  .fl-rail i.w { background: #5fd08f; }
  .fl-rail .on i { background: #241a05; color: #f2cf78; }
  body.ph.of.fl .fl-here { display: flex; align-items: baseline; gap: 7px; position: absolute; left: 10px; bottom: 10px; z-index: 3; max-width: calc(100% - 110px); padding: 5px 11px; border-radius: 9px; background: rgba(22, 24, 29, .9); border: 1px solid var(--line); white-space: nowrap; pointer-events: none; }
  .fl-here b { color: var(--accent); font-size: 17px; }
  .fl-here span { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
  body.ph.of.fl .fl-wide { display: block; position: absolute; right: 6px; bottom: 8px; z-index: 3; min-height: 32px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: rgba(22, 24, 29, .9); color: var(--text); font-size: 13px; white-space: nowrap; }
  body.ph.of.fl .fl-wide::after { content: ""; position: absolute; inset: -5px -6px -8px; }
  body.ph.of.fl .fl-bar { display: flex; position: absolute; left: 8px; top: 5px; z-index: 3; gap: 5px; margin: 0; }
  body.ph.of.fl .stage-box:has(> .fl-bar button:not(:disabled)) { padding-top: 36px; }
  body.ph.of.fl .fl-bar button { min-height: 0; height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 999px; background: rgba(22, 24, 29, .9); gap: 5px; position: relative; }
  body.ph.of.fl .fl-bar button::after { content: ""; position: absolute; inset: -5px -2px; }
  body.ph.of.fl .fl-bar button b { font-size: 14px; }
  body.ph.of.fl .fl-bar button:disabled { display: none; }
  body.ph.of.fl .ph-chips { display: flex; gap: 6px; margin: 8px 0 0; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
  body.ph.of.fl .ph-chips::-webkit-scrollbar { display: none; }
  body.ph.fl .ph-chips button { flex: none; flex-direction: row; min-height: 36px; padding: 0 12px; border-radius: 999px; gap: 6px; }
  body.ph.fl .ph-chips b { font-size: 14px; font-weight: 650; }
  body.ph.fl .ph-chips .one { align-self: center; font-size: 14px; font-weight: 650; white-space: nowrap; }
  body.ph.of.fl .ph-list, body.ph.of.fl > .hint { padding: 0 12px; }
  body.ph.fl .ph-list .ph-h { margin: 14px 0 6px; font-size: 15px; }
  body.ph.fl .ph-list .ph-row { min-height: 54px; padding: 6px 10px; margin-bottom: 6px; gap: 10px; border-radius: 10px; }
  body.ph.fl .ph-list .ph-row canvas { width: 26px; height: 39px; }
  body.ph.fl .ph-list .ph-row .n { font-size: 14.5px; }
  body.ph.fl .ph-list .ph-row .w { font-size: 13px; margin-top: 1px; }
  body.ph.fl .ph-list .ph-row .s { font-size: 12px; padding: 3px 8px; }
  body.ph.fl .fl-fixbtn { min-height: 44px; }
}
@media (max-width: 360px) {
  body.ph .top { padding: 7px 8px; }
  body.ph .tabs { left: 30px; }
  body.ph .tabs button { padding: 0 8px; font-size: 14px; }
  body.ph .ph-top button { padding: 0 6px; font-size: 13px; }
  body.ph .who button { padding: 5px 5px; font-size: 13px; }
  .fl-rail button { height: 38px; }
}

/* 그림 바꾸기(도트 새 그림 1125) */
.dot-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 8px 0 10px; }
.dot-tools[hidden], body.fl-all .dot-tools { display: none; }
.dot-tools button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
.dot-tools button:hover { color: var(--text); }
.dot-when { align-self: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .dot-when { flex: 1 0 100%; text-align: right; } }
.dot-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dot-seg button { border: 0; border-radius: 0; min-width: 48px; }
.dot-seg button + button { border-left: 1px solid var(--line); }
.dot-seg button[aria-pressed="true"] { background: #e9c46a; color: #16181d; font-weight: 600; }
/* 폰 사무실: 방 이름표 아래 얇은 한 줄(보이는 높이 32 · 누르는 높이 44). 시각은 '자동'일 때만 */
body.ph.of .dot-tools { justify-content: flex-start; gap: 4px; margin: 2px 0 0; padding: 0 9px; }
body.ph.of .dot-tools button { border: 6px solid transparent; border-width: 6px 3px; border-radius: 15px; background-clip: padding-box; padding: 0 10px; min-width: 0; }
body.ph.of .dot-seg, body.ph.of .dot-seg button + button { border-color: transparent; }
body.ph.of .dot-tools .dot-seg button { min-width: 44px; }
body.ph.of .dot-tools > button { margin-left: auto; }
body.ph.of .dot-when { flex: 1 0 100%; order: 3; text-align: left; padding: 0 12px 4px; }
body.ph.of .dot-when:has(+ .dot-seg [data-light="day"][aria-pressed="true"]), body.ph.of .dot-when:has(+ .dot-seg [data-light="night"][aria-pressed="true"]) { display: none; }
