/* 세대 | 공용부 pager and the common-area board (이슈 #9). The board reuses .unit-board tones; cb-* and bp-* are new. */
.board-pager{--bp-teal:#1d6a5a;--bp-ink:#1e3832;--bp-muted:#6b7a72;position:relative;min-width:0;max-width:100%}
.board-pager .bp-bar{display:flex;flex-direction:column;align-items:center;gap:4px;margin:0 0 10px}
.board-pager .bp-switch{position:relative;display:grid;grid-template-columns:1fr 1fr;width:min(100%,360px);padding:4px;border-radius:999px;background:#eef2f0;box-shadow:inset 0 0 0 1px #e1e8e4}
.board-pager .bp-tab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 12px;border:0;border-radius:999px;background:none;color:var(--bp-muted);font:inherit;font-size:15px;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color .2s}
.board-pager .bp-tab small{min-width:22px;padding:0 6px;border-radius:999px;background:#dfe7e3;color:#4f625a;font-size:11px;font-weight:800;line-height:18px;font-variant-numeric:tabular-nums}
.board-pager .bp-tab.bp-on{color:var(--bp-teal)}
.board-pager .bp-tab.bp-on small{background:var(--bp-teal);color:#fff}
.board-pager .bp-tab:focus-visible{outline:3px solid #7cc6b4;outline-offset:1px}
.board-pager .bp-thumb{position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:999px;background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.08),0 3px 10px rgba(16,24,40,.10);transition:transform .28s cubic-bezier(.2,.8,.2,1)}
.board-pager[data-page="common"] .bp-thumb{transform:translateX(100%)}
.board-pager .bp-hint{margin:0;font-size:11px;color:#98a29d;letter-spacing:.02em}
.board-pager .bp-viewport{overflow:hidden;min-width:0}
@supports (overflow:clip){.board-pager .bp-viewport{overflow:clip}}
.board-pager .bp-track{display:flex;align-items:flex-start;transition:transform .3s cubic-bezier(.2,.8,.2,1);will-change:transform}
.board-pager[data-page="common"] .bp-track{transform:translateX(-100%)}
.board-pager .bp-pane{flex:0 0 100%;min-width:0;max-width:100%}
.board-pager .bp-pane.bp-off{height:0;overflow:hidden;visibility:hidden}
@media (prefers-reduced-motion:reduce){.board-pager .bp-track,.board-pager .bp-thumb,.board-pager .bp-tab{transition:none}}
@media (hover:hover){.board-pager .bp-tab:not(.bp-on):hover{color:var(--bp-ink)}}
@media print{.board-pager .bp-bar{display:none}.board-pager .bp-track{transform:none!important;display:block}.board-pager .bp-pane.bp-off{display:none}}

/* Board body */
.common-board .cb-sides{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:4px;font-size:12px;color:var(--ub-muted)}
.common-board .cb-sides span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.cb-side{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:6px;font-size:11px;font-weight:800;line-height:1;font-style:normal;flex:0 0 auto}
.cb-side-A{background:#e2efe8;color:#1d6a5a}
.cb-side-B{background:#f6e7da;color:#7d4322}
.common-board .cb-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:6px}
.common-board .cb-card{min-height:62px;cursor:default}
.common-board .cb-card strong{white-space:nowrap}
.common-board .cb-card-done strong{color:var(--ub-teal)}
.common-board .cb-card-defects strong{color:var(--ub-peach-ink)}
.common-board .cb-card-closed strong{color:#3d6488}
.common-board .cb-card-closed .ub-card-pct{color:#3d6488}
.common-board .cb-tally{margin:0 0 12px;font-size:12px;color:var(--ub-muted)}

.common-board .cb-group{margin-top:14px}
.common-board .cb-group h3{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:14px;font-weight:800;color:var(--ub-ink)}
.common-board .cb-group h3 small{padding:0 7px;border-radius:999px;background:#eef2f0;color:var(--ub-muted);font-size:11px;font-weight:700;line-height:18px}
.common-board .cb-chips{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.common-board .cb-add{margin-top:8px;min-height:44px;align-items:center;border-style:dashed;color:var(--ub-teal)}

.common-board .cb-area{min-height:58px;gap:2px}
.common-board .cb-area-name{display:flex;align-items:center;gap:5px;min-width:0;font-size:13px;font-weight:800;line-height:1.25;color:var(--ub-ink)}
.common-board .cb-area .ub-unit-state{font-size:12px}
.common-board .ub-tone-todo{background:#fbfaf7;border:1.5px dashed #cdc5b7}
.common-board .ub-tone-todo .ub-unit-state{color:#857d70;font-weight:700}
.common-board .ub-tone-todo:hover{border-color:var(--ub-teal);background:#f3f8f5}
.common-board .cb-tone-todo-sw{background:#fbfaf7;border:1.5px dashed #cdc5b7}
.common-board .cb-legend-note{white-space:normal!important;font-weight:600;color:var(--ub-muted)!important}

/* Floor table (이슈 #11): 40F at the top down to B2; A 계단실 | A 공용홀 | B 계단실 | B 공용홀.
   Fixed layout at 100% width, so on a 360~430px phone the four columns share the width and the table never scrolls sideways. */
.common-board .cb-tower{border:1px solid var(--ub-line);border-top:4px solid var(--ub-teal);border-radius:12px 12px 6px 6px;background:var(--ub-paper);box-shadow:0 6px 0 -3px #d9d1c3;overflow:hidden}
.common-board .cb-grid{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
.common-board .cb-grid .cb-col-floor{width:50px}
.common-board .cb-grid th,.common-board .cb-grid td{padding:2px 2px}
.common-board .cb-grid thead th{font-size:12px;font-weight:700;color:var(--ub-muted);text-align:center;line-height:1.2}
.common-board .cb-grid .cb-side-head{padding-top:6px;padding-bottom:2px}
.common-board .cb-grid .cb-side-head .cb-side{margin-right:4px;vertical-align:middle}
.common-board .cb-grid .cb-side-head small{font-size:10px;font-weight:600;letter-spacing:-.2px;white-space:nowrap}
.common-board .cb-grid .cb-cols th{height:24px;padding-bottom:4px;border-bottom:1px solid var(--ub-line);font-size:11.5px;color:var(--ub-ink)}
.common-board .cb-grid .cb-corner,.common-board .cb-grid .cb-floor{border-right:1px solid var(--ub-line);text-align:center}
.common-board .cb-grid .cb-corner{border-bottom:1px solid var(--ub-line)}
/* A gap between the A pair and the B pair so the two sides read as two blocks. */
.common-board .cb-grid .cb-b{border-left:2px solid #e3dccf;padding-left:4px}
/* 주차장 (이슈 #13): a narrower middle column between A and B, B2~8F only; the empty cells above 8F stay blank. */
.common-board .cb-grid .cb-col-park{width:15%}
.common-board .cb-grid .cb-p{border-left:2px solid #e3dccf;padding-left:4px;background:#f6f8fa}
.common-board .cb-grid .cb-park-head{vertical-align:bottom;padding-bottom:4px;border-bottom:1px solid var(--ub-line);font-size:11.5px;color:var(--ub-ink)}
.common-board .cb-floor{font-size:13px;font-weight:800;color:var(--ub-ink);line-height:1.15}
.common-board .cb-grid td{vertical-align:top;height:1px}
.common-board .cb-grid .cb-area{width:100%;height:100%;min-width:0;min-height:46px;padding:5px 6px;border-radius:8px;overflow:hidden}
.common-board .cb-grid .cb-area-name{display:block;font-size:10.5px;font-weight:800;line-height:1.2;color:var(--ub-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.common-board .cb-row-special th,.common-board .cb-row-special td{background:#faf7f1}
.common-board .cb-grid tbody tr:last-child th,.common-board .cb-grid tbody tr:last-child td{border-bottom:3px solid #cfc6b6}

/* 비활성 구역: dimmed, never counted. An opened one still opens to show its records. */
.common-board .ub-tone-off{background:repeating-linear-gradient(135deg,#f3f1ec 0 6px,#f8f6f2 6px 12px);border:1px dashed #d6d0c5;opacity:.62}
.common-board .ub-tone-off .ub-unit-state{color:#8b857b;font-weight:700}
.common-board span.ub-tone-off{display:flex;flex-direction:column;justify-content:center;cursor:default}
.common-board .cb-tone-off-sw{background:repeating-linear-gradient(135deg,#ebe7df 0 3px,#f8f6f2 3px 6px);border:1px dashed #cfc8bb}
/* 구역 관리 mode (owner): every cell opens the settings dialog; a teal ring says so. */
.common-board .cb-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px}
.common-board .cb-toolbar .cb-tally{margin:0}
.common-board .cb-manage-toggle{flex:0 0 auto;min-height:40px;padding:6px 14px;align-items:center;color:var(--ub-teal);font-weight:700}
.common-board .cb-manage-toggle.cb-on{background:var(--ub-teal);border-color:var(--ub-teal);color:#fff}
.common-board .cb-manage-help{margin:-4px 0 10px;padding:8px 10px;border-radius:8px;background:#e8f3ef;color:#1d5a4d;font-size:12px;line-height:1.45}
.common-board.cb-manage .cb-managing{border:1.5px solid #7cc6b4}
.common-board.cb-manage .cb-managing.ub-tone-off{opacity:.85}
.common-board .cb-group-note{margin:-2px 0 8px;font-size:12px;color:var(--ub-muted)}

@media (max-width:359px){
  .common-board .cb-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .common-board .cb-grid .cb-col-floor{width:34px}
}
@media (max-width:600px){
  .board-pager .bp-switch{width:100%}
  .common-board .cb-cards{gap:6px}
  .app-shell.unit-board-mode .common-board .cb-card{min-height:54px;padding:7px 8px}
  .app-shell.unit-board-mode .common-board .cb-card strong{font-size:18px}
  /* 360px: (340 − 36 − 58) ÷ 4 ≈ 61px per side column, 58px for 주차장; each cell stays at least 44px tall for a thumb. */
  .common-board .cb-grid .cb-col-floor{width:36px}
  .common-board .cb-grid .cb-col-park{width:58px}
  .common-board .cb-grid th,.common-board .cb-grid td{padding:2px 1px}
  .common-board .cb-grid .cb-b,.common-board .cb-grid .cb-p{padding-left:3px}
  .common-board .cb-grid .cb-p .cb-area{padding:4px 3px}
  .common-board .cb-grid .cb-area{min-height:46px;padding:4px 4px;border-radius:7px}
  .common-board .cb-floor{font-size:12px;letter-spacing:-.3px}
  .common-board .cb-grid .ub-unit-state{font-size:11px;line-height:1.2;letter-spacing:-.3px;word-break:keep-all}
  .common-board .cb-grid .ub-unit-sub{font-size:10px;letter-spacing:-.3px}
  .common-board .cb-grid .cb-side-head small{display:block;margin-top:1px}
}
@media (min-width:690px){
  .common-board .cb-chips{grid-template-columns:repeat(4,minmax(0,1fr))}
  .common-board .cb-tower{max-width:720px}
}
@media (min-width:1104px){.common-board .cb-chips{grid-template-columns:repeat(6,minmax(0,1fr))}}
.app-shell.unit-board-mode .common-board .cb-card{background:#fff;border:0;box-shadow:0 1px 2px rgba(16,24,40,.06),0 4px 14px rgba(16,24,40,.08)}
@media print{.common-board .cb-tower{box-shadow:none}.common-board .cb-add{display:none}}
/* Unit screen header: owner-only 구역 관리 next to 세대 변경. */
.unit-area-button{margin-left:auto}

/* 공용부 사진대지·하자목록 내려받기 (이슈 #20): the 구역 선택 is the 세대 one (form.unit-board.photo-sheet, unitboard.css) drawn in the
   공용부 현황판's shape. The 층 table is fixed at the dialog's width (층 + A 계단실 | A 공용홀 | 주차장 | B 계단실 | B 공용홀), so on a
   360px phone each column is about 45px and nothing scrolls sideways; a long name wraps onto more lines instead of widening the cell. */
.unit-board.photo-sheet .ps-agrid .ps-col{gap:2px;padding:3px 1px}
.unit-board.photo-sheet .ps-agrid .ps-col .cb-side{width:16px;height:16px;border-radius:5px;font-size:10px}
.unit-board.photo-sheet .ps-agrid .ps-col span{max-width:100%;font-size:11px;letter-spacing:-.3px;overflow-wrap:anywhere}
.unit-board.photo-sheet .ps-agrid .ps-floor{font-size:11.5px;letter-spacing:-.3px}
.unit-board.photo-sheet .ps-agrid td.ps-p{background:#eef2f5;border-radius:8px}
.unit-board.photo-sheet .ps-area b,.unit-board.photo-sheet .ps-area small{display:block;max-width:100%;text-align:center;word-break:normal;overflow-wrap:anywhere}
/* 비활성 and never-opened 구역 are dim (비활성 striped as on the board); a picked 구역 without 하자 stays light: 빈 결과. */
.unit-board.photo-sheet .ps-area.ps-dim{border-style:dashed;opacity:.6}
.unit-board.photo-sheet .ps-area.ps-off:not(.ps-on){background:repeating-linear-gradient(135deg,#f3f1ec 0 6px,#f8f6f2 6px 12px)}
.unit-board.photo-sheet .ps-area.ps-on.ps-dim{opacity:.85}
.unit-board.photo-sheet .ps-area.ps-on.ps-zero{background:var(--ps-soft);border-color:var(--ps-teal);color:var(--ps-teal);box-shadow:none}
.unit-board.photo-sheet .ps-area.ps-on.ps-zero small{color:var(--ps-teal)}
/* 묶음 (옥상·승강기·지하 설비·9층 커뮤니티…): the title picks the whole 묶음; its 구역 sit as chips, two a row on a phone. */
.unit-board.photo-sheet .ps-agroup{margin:8px 0}
.unit-board.photo-sheet .ps-group{flex-direction:row;justify-content:flex-start;gap:6px;width:auto;min-height:34px;margin-bottom:6px;padding:4px 12px}
.unit-board.photo-sheet .ps-group small{padding:0 7px;border-radius:999px;background:#eef2f0;color:var(--ps-muted);font-size:11px;line-height:18px}
.unit-board.photo-sheet .ps-chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:4px}
.unit-board.photo-sheet .ps-note{margin:8px 0 0;font-size:11.5px;line-height:1.45;color:var(--ps-muted)}
@media (max-width:420px){
  .unit-board.photo-sheet .ps-agrid .ps-col span{font-size:10px}
  .unit-board.photo-sheet .ps-area b{font-size:11px}
  .unit-board.photo-sheet .ps-chips{grid-template-columns:repeat(2,minmax(0,1fr))}
}
