/* ============================================================
   SMARTC&S theme layer — 디자인 시스템 하네스(smartcs-components.css)
   의 룩을 앱 전체(부트스트랩·dbc·dcc·dash_table 내부까지)에 강제한다.
   토큰은 00_tokens.css, 컴포넌트 계약은 DS components/ 가 정본.
   ============================================================ */

/* ---- 서체: 모든 표면에서 IBM Plex ---- */
body, .app-shell, .btn, .form-control, .form-select, .dropdown-menu, .modal, .toast,
.nav-tabs, .alert, .badge, .Select, .dash-table-container, .DateInput_input {
  font-family: var(--font-sans) !important;
}
body { background: var(--bg-app); color: var(--fg1); font-size: var(--text-body); }
.ds-mono, code, .DateInput_input, input[type="number"] { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; }

/* ---- 레이아웃 ---- */
.shell-page { padding: 20px 24px 32px; }
.topbar { padding: 12px 24px; min-height: 60px; }
.topbar-title { font-size: 17px; }
.topbar-sub { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; }
.topbar-sub .nav-ico { color: var(--fg4); }
.topbar-project { gap: 7px !important; padding: 7px 12px !important; font-size: 13px !important; box-shadow: none !important; }
.topbar-project::after { margin-left: 2px; opacity: .6; }
.sidebar-logo { padding: 16px 18px; }
.sidebar-logo img { height: 24px; }
.sidebar-group-label { padding: 14px 10px 4px; }
.nav-item { padding: 8px 10px; font-size: 13px; }

/* ---- 카드 ---- */
.ds-card { border-radius: var(--r-lg) !important; box-shadow: var(--shadow-xs) !important; }
.ds-card__head { padding: 11px 16px !important; }
.ds-card__title { font-size: 13.5px !important; letter-spacing: -0.005em; }
.app-shell .card { border: 1px solid var(--line-1); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.app-shell .card-header { background: #fff; border-bottom: 1px solid var(--line-1); font-weight: 600; font-size: 13.5px; padding: 11px 16px; }
.app-shell .card-body { padding: 16px; }

/* ---- 버튼 (dbc.Button → DS 버튼과 동일 룩) ---- */
.app-shell .btn {
  font-size: 13px; font-weight: 500; line-height: 1; padding: 9px 15px;
  border-radius: var(--r-sm); border: 1px solid transparent; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast);
}
.app-shell .btn-sm { font-size: 12px; padding: 7px 11px; }
.app-shell .btn-primary { background: var(--blue-500); border-color: transparent; color: #fff; }
.app-shell .btn-primary:hover, .app-shell .btn-primary:focus { background: var(--blue-600); border-color: transparent; }
.app-shell .btn-secondary, .app-shell .btn-light, .app-shell .btn-outline-secondary, .app-shell .btn-outline-primary {
  background: #fff; color: var(--fg1); border-color: var(--line-2);
}
.app-shell .btn-secondary:hover, .app-shell .btn-light:hover, .app-shell .btn-outline-secondary:hover,
.app-shell .btn-outline-primary:hover { background: var(--ink-50); color: var(--fg1); border-color: var(--line-2); }
.app-shell .btn-danger { background: var(--crit-500); border-color: transparent; }
.app-shell .btn-danger:hover { background: var(--crit-600); }
.app-shell .btn-outline-danger { background: #fff; color: var(--crit-600); border-color: var(--crit-200); }
.app-shell .btn-outline-danger:hover { background: var(--crit-50); color: var(--crit-600); }
.app-shell .btn-success { background: var(--ok-500); border-color: transparent; }
.app-shell .btn-success:hover { background: var(--ok-600); }
.app-shell .btn-warning { background: var(--warn-500); border-color: transparent; color: #fff; }
.app-shell .btn-info { background: var(--blue-400); border-color: transparent; color: #fff; }
.app-shell .btn:focus-visible, .app-shell .ds-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.app-shell .btn:disabled, .app-shell .btn.disabled { background: var(--ink-100); color: var(--fg4); border-color: transparent; opacity: 1; }

/* ---- 입력 (dbc.Input / form-control / dcc.Input) ---- */
.app-shell .form-control, .app-shell .form-select, .app-shell input.ds-input, .app-shell textarea.ds-textarea {
  height: 38px; font-size: 13.5px; color: var(--fg1); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: none; padding: 0 11px;
}
.app-shell textarea.form-control, .app-shell textarea.ds-textarea { height: auto; padding: 9px 11px; }
.app-shell .form-control:focus, .app-shell .form-select:focus, .app-shell .ds-input:focus {
  border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--focus-ring); outline: none;
}
.app-shell .form-control::placeholder { color: var(--fg4); }
.app-shell .form-label, .app-shell label.t-label { font-size: 13px; font-weight: 500; color: var(--fg1); margin-bottom: 6px; }
.app-shell h6 { font-size: 13px; font-weight: 600; color: var(--fg2); }

/* dcc.Dropdown (react-select) */
.app-shell .Select-control { height: 38px; box-shadow: none !important; }
.app-shell .Select-placeholder, .app-shell .Select--single > .Select-control .Select-value { line-height: 36px; font-size: 13.5px; }
.app-shell .Select-placeholder { color: var(--fg4) !important; }
.app-shell .Select-input { height: 36px; }
.app-shell .Select-arrow { border-top-color: var(--fg3); }
.app-shell .Select-menu-outer { margin-top: 4px; }
.app-shell .Select-option { font-size: 13px; padding: 8px 11px; color: var(--fg1); }
.app-shell .Select-option.is-selected { background: var(--blue-50); color: var(--blue-700); font-weight: 500; }
.app-shell .Select--multi .Select-value { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); border-radius: var(--r-xs); font-size: 12px; }

/* 날짜 선택 */
.app-shell .DateInput_input { height: 36px; font-size: 13px; border-bottom: none; padding: 0 10px; }
.app-shell .DateRangePickerInput, .app-shell .SingleDatePickerInput { border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.app-shell .DateInput_input__focused { border-bottom: none; }
.app-shell .CalendarDay__selected, .app-shell .CalendarDay__selected:hover { background: var(--blue-500); border-color: var(--blue-500); }
.app-shell .CalendarDay__selected_span { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }

/* 스위치·체크·라디오 */
.app-shell .form-check-input { border-color: var(--line-2); width: 16px; height: 16px; margin-top: 2px; }
.app-shell .form-check-input:checked { background-color: var(--blue-500); border-color: var(--blue-500); }
.app-shell .form-check-input:focus { box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--blue-500); }
.app-shell .form-switch .form-check-input { width: 32px; height: 18px; }
.app-shell .form-check-label { font-size: 13px; color: var(--fg1); }

/* 세그먼트(dcc.RadioItems .ds-segmented) */
.app-shell .ds-segmented label { transition: background var(--dur-fast), color var(--dur-fast); }
.app-shell .ds-segmented label:has(input:checked) { background: #fff; color: var(--blue-700); box-shadow: var(--shadow-xs); }

/* ---- 탭 ---- */
.app-shell .nav-tabs { border-bottom: 1px solid var(--line-1); gap: 2px; }
.app-shell .nav-tabs .nav-link { padding: 8px 12px; color: var(--fg2); border: none; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; border-radius: 0; margin-bottom: -1px; }
.app-shell .nav-tabs .nav-link:hover { color: var(--fg1); background: transparent; border-bottom-color: var(--line-2); }
.app-shell .nav-tabs .nav-link.active { color: var(--blue-700); border-bottom: 2px solid var(--blue-500); background: transparent; }
/* 연결형 세그먼트 탭(.an-seg) — dbc.Tabs 는 className 을 Nav(=ul.nav.nav-tabs) 에 그대로 얹으므로
   한 요소에 두 클래스가 같이 온다. flex 줄 안에서는 flex item 의 min-width:auto 가 «가장 넓은 탭»
   폭까지 줄여도 된다고 봐서, 부트스트랩 기본 .nav{flex-wrap:wrap} 이 발동해 탭이 행으로 쌓였다
   — nowrap 과 flex:0 0 auto 로 막는다(2026-09-17). */
.app-shell .an-seg.nav-tabs { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.app-shell .an-seg .nav-item + .nav-item { border-left: 1px solid var(--line-2); }
.app-shell .an-seg .nav-link { border: none; border-bottom: none; margin: 0; padding: 7px 14px; white-space: nowrap; }
.app-shell .an-seg .nav-link.active { background: var(--blue-50); color: var(--blue-700); border-bottom: none; }

/* ---- 알림·배지·토스트·모달 ---- */
.app-shell .alert { border-radius: var(--r-sm); font-size: 13px; padding: 10px 12px; border: 1px solid transparent; }
.app-shell .alert-primary, .app-shell .alert-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.app-shell .alert-success { background: var(--ok-50); color: var(--ok-600); border-color: #CFE9DB; }
.app-shell .alert-warning { background: var(--warn-50); color: var(--warn-600); border-color: #F0DDB5; }
.app-shell .alert-danger { background: var(--crit-50); color: var(--crit-600); border-color: var(--crit-200); }
.app-shell .alert-secondary, .app-shell .alert-light { background: var(--ink-50); color: var(--fg2); border-color: var(--line-1); }
.app-shell .badge { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 8px; border-radius: 999px; }
.app-shell .badge.bg-primary { background: var(--blue-50) !important; color: var(--blue-700); }
.app-shell .badge.bg-success { background: var(--ok-50) !important; color: var(--ok-600); }
.app-shell .badge.bg-warning { background: var(--warn-50) !important; color: var(--warn-600); }
.app-shell .badge.bg-danger { background: var(--crit-50) !important; color: var(--crit-600); }
.app-shell .badge.bg-secondary, .app-shell .badge.bg-light { background: var(--ink-100) !important; color: var(--ink-600); }
.toast { border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 13px; }
.toast-header { border-bottom: 1px solid var(--line-1); font-weight: 600; color: var(--fg1); }
.modal-content { border: 1px solid var(--line-1); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-1); padding: 14px 18px; }
.modal-title, .modal-header { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px; font-size: 13.5px; }
.modal-footer { border-top: 1px solid var(--line-1); padding: 12px 18px; gap: 8px; }
.modal-backdrop.show { background: rgba(20,23,26,.5); opacity: 1; }

/* ---- 드롭다운 메뉴(프로젝트 전환) ---- */
.dropdown-menu { border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 6px; font-size: 13px; min-width: 240px; }
.dropdown-item { border-radius: var(--r-xs); padding: 8px 10px; color: var(--fg1); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--blue-50); color: var(--blue-700); }
.dropdown-item.disabled { color: var(--fg4); }

/* ---- 표 ---- */
.app-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
.app-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td { line-height: 1.4; }
.app-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner input[type="checkbox"],
.app-shell .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner input[type="radio"] { accent-color: var(--blue-500); }
.app-shell .dash-table-container .previous-next-container { font-size: 12.5px; color: var(--fg3); padding-top: 8px; }
.app-shell .dash-table-container .previous-next-container .page-number { font-family: var(--font-mono); }
.app-shell .dash-table-container .previous-next-container button { border: 1px solid var(--line-2); border-radius: var(--r-xs); background: #fff; color: var(--fg2); }
.app-shell table.table { font-size: 13px; }
.app-shell table.table th { background: var(--ink-100); color: var(--fg2); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line-2); }
.app-shell table.table td { border-bottom: 1px solid var(--line-1); }
.app-shell .text-muted { color: var(--fg3) !important; }

/* ---- 슬라이더 ---- */
.app-shell .rc-slider-rail { background: var(--ink-200); }
.app-shell .rc-slider-handle { background: #fff; box-shadow: var(--shadow-xs); }
.app-shell .rc-slider-mark-text { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); }

/* ---- 그래프 캔버스 모서리 ---- */
.app-shell .js-plotly-plot, .app-shell .dash-graph { border-radius: var(--r-md); overflow: hidden; }

/* ---- 로그인 ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-app); padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line-1); border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: 40px 36px 32px; }
.login-card-inner { display: flex; flex-direction: column; align-items: stretch; }
.login-logo { height: 30px; align-self: center; }
.login-title { font-size: 13px; font-weight: 500; color: var(--fg3); text-align: center; margin: 10px 0 28px; }
.login-field { position: relative; margin-bottom: 10px; }
.login-field-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.app-shell .login-input.form-control, .login-input { height: 44px; padding-left: 40px !important; font-size: 14px; width: 100%; }
.login-submit { width: 100%; height: 44px; margin-top: 6px; background: var(--blue-500); color: #fff; border: none; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
.login-error { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding: 10px 12px; background: var(--crit-50); color: var(--crit-600); border: 1px solid var(--crit-200); border-radius: var(--r-sm); font-size: 13px; }

/* ---- 반응형 ---- */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-logo img { height: 20px; }
  .sidebar-group-label, .nav-item span, .user-chip > div:last-child, .nav-logout span { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .shell-page { padding: 14px; }
  .topbar { padding: 10px 14px; }
}

/* ---- .ds-btn 기본 (DS smartcs-components.css 이식 — className 만 단 버튼도 같은 룩) ---- */
.ds-btn { font-family: var(--font-sans); font-size: 13px; font-weight: 500; line-height: 1; padding: 9px 15px;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.ds-btn--primary { background: var(--blue-500); color: #fff; }
.ds-btn--secondary { background: #fff; color: var(--fg1); border-color: var(--line-2); }
.ds-btn--ghost { background: transparent; color: var(--blue-600); }
.ds-btn--danger { background: var(--crit-500); color: #fff; }
.ds-btn.dropdown-toggle::after { margin-left: 4px; vertical-align: 1px; }
.ds-btn.dropdown-toggle.show { background: var(--ink-50); }

/* ---- 온도센서 목록: 폴더 트리 ---- */
.sdv-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--fg1); transition: background var(--dur-fast); }
.sdv-row:hover { background: var(--ink-50); }
.sdv-folder.is-open { background: var(--ink-50); }
.sdv-sensor { padding-left: 34px; color: var(--fg2); }
.sdv-sensor.is-active { background: var(--blue-50); color: var(--blue-700); }
.sdv-count { font-size: 11px; color: var(--fg3); background: var(--ink-100); border-radius: 999px; padding: 2px 8px; }
.sdv-empty { padding: 8px 10px 8px 34px; font-size: 12px; color: var(--fg4); }
#sdv-range-modal .modal-dialog { max-width: 420px; }

/* ---- 표 정렬 아이콘 ---- */
.app-shell .dash-table-container .dash-header .column-header--sort { margin-left: 4px; color: var(--fg4); vertical-align: middle; cursor: pointer; }
.app-shell .dash-table-container .dash-header .column-header--sort svg { width: 10px; height: 12px; }
.app-shell .dash-table-container .dash-header:hover .column-header--sort { color: var(--fg2); }
.app-shell .dash-table-container .dash-header .column-header--sort .fa-sort-up,
.app-shell .dash-table-container .dash-header .column-header--sort .fa-sort-down { color: var(--blue-500); }
.app-shell .dash-table-container .dash-header .column-header-name { vertical-align: middle; }

/* ---- 기간 팝업 ---- */
.sdv-range-modal .modal-dialog { max-width: 400px; }
.sdv-range-modal .modal-content { overflow: visible; }
.sdv-range-modal .modal-header { padding: 12px 16px; }
.sdv-range-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.sdv-range-modal .modal-body { padding: 16px; }
.sdv-range-modal .modal-footer { padding: 10px 16px; }
.sdv-range-modal .DateRangePicker, .sdv-range-modal .DateRangePickerInput { width: 100%; display: flex; align-items: center; }
.sdv-range-modal .DateRangePickerInput { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; }
.sdv-range-modal .DateInput { flex: 1; width: auto; background: transparent; }
.sdv-range-modal .DateInput_input { width: 100%; height: 40px; font-family: var(--font-mono); font-size: 13.5px; text-align: center; background: transparent; }
.sdv-range-modal .DateInput_input__focused { border-bottom: 2px solid var(--blue-500); }
.sdv-range-modal .DateRangePickerInput_arrow { color: var(--fg4); padding: 0 6px; }
.sdv-range-modal .DateRangePickerInput_arrow_svg { width: 18px; height: 18px; fill: var(--fg4); }
.sdv-range-modal .DateRangePicker_picker { z-index: 1060; }
.sdv-range-modal .CalendarDay__default { border-color: var(--line-1); color: var(--fg1); font-family: var(--font-mono); }
.sdv-range-modal .CalendarDay__selected_span { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.sdv-range-modal .CalendarDay__selected, .sdv-range-modal .CalendarDay__selected:hover { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.sdv-range-modal .CalendarDay__hovered_span, .sdv-range-modal .CalendarDay__hovered_span:hover { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.sdv-range-modal .DayPickerNavigation_button__default { border-color: var(--line-2); border-radius: var(--r-xs); }
.sdv-range-modal .CalendarMonth_caption { font-family: var(--font-sans); font-size: 14px; color: var(--fg1); }
.sdv-range-modal .DayPicker_weekHeader { color: var(--fg3); font-size: 11px; }

/* 달력 요일 머리글 한글화 — dcc.DatePickerRange 는 locale prop 이 없어 CSS 로 바꿔 끼운다 */
.sdv-range-modal .DayPicker_weekHeader_li small { font-size: 0; }
.sdv-range-modal .DayPicker_weekHeader_li small::after { font-size: 11px; color: var(--fg3); }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(1) small::after { content: "일"; color: var(--crit-500); }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(2) small::after { content: "월"; }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(3) small::after { content: "화"; }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(4) small::after { content: "수"; }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(5) small::after { content: "목"; }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(6) small::after { content: "금"; }
.sdv-range-modal .DayPicker_weekHeader_li:nth-child(7) small::after { content: "토"; color: var(--blue-500); }

/* ---- 사이드바: 현재 프로젝트 칸 ---- */
.sidebar-project { display: flex; align-items: center; gap: 8px; margin: 12px 12px 0; padding: 10px 12px;
  border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--ink-50);
  color: var(--fg1); text-decoration: none; font-size: 13px; font-weight: 600; transition: border-color var(--dur-fast); }
.sidebar-project:hover { border-color: var(--blue-300); color: var(--fg1); }
.sidebar-project .nav-ico:first-child { color: var(--blue-500); }
.sidebar-project .nav-ico:last-child { color: var(--fg4); margin-left: auto; }
.sidebar-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-project.is-empty { color: var(--fg3); font-weight: 500; border-style: dashed; background: #fff; }

/* ---- 콘크리트 작업 화면: 단계 표시줄 ---- */
.ws { background: #fff; border-bottom: 1px solid var(--line-1); padding: 0 24px; }
.ws-bar { display: flex; align-items: center; gap: 16px; padding: 10px 0; flex-wrap: wrap; }
.ws-head { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ws-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--r-sm); color: var(--fg3); border: 1px solid var(--line-2); }
.ws-back:hover { background: var(--ink-50); color: var(--fg1); }
.ws-concrete { gap: 7px !important; font-weight: 600 !important; }
.ws-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ws-step { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px; border-radius: 999px;
  color: var(--fg3); text-decoration: none; font-size: 13px; font-weight: 500; transition: background var(--dur-fast); }
.ws-step:hover { background: var(--ink-50); color: var(--fg1); }
.ws-step + .ws-step::before { content: ""; width: 14px; height: 1px; background: var(--line-2); margin: 0 4px 0 -10px; }
.ws-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--ink-100); color: var(--fg3); flex-shrink: 0; }
.ws-step.is-done .ws-no { background: var(--blue-50); color: var(--blue-600); }
.ws-step.is-done { color: var(--fg2); }
.ws-step.is-run .ws-no { background: var(--warn-50); color: var(--warn-600); }
.ws-step.is-active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.ws-step.is-active .ws-no { background: var(--blue-500); color: #fff; }

/* ---- 콘크리트 카드: 단계 진행 점 ---- */
.ws-pips { display: flex; gap: 5px; align-items: center; }
.ws-pip { width: 22px; height: 6px; border-radius: 999px; background: var(--ink-200); }
.ws-pip.is-done { background: var(--blue-400); }
.ws-pip.is-run { background: var(--warn-500); }
@media (max-width: 900px) { .ws { padding: 0 14px; } .ws-label { display: none; } .ws-step { padding: 4px; } }
a.ds-btn, a.ds-btn:hover, a.ds-btn:focus { text-decoration: none; }
a.ds-btn--primary:hover { color: #fff; }
a.ds-btn--secondary:hover { color: var(--fg1); }

/* ---- 콘크리트 목록: 한 줄에 하나 ---- */
.cc-head, .cc-row { display: grid; align-items: center; gap: 12px; padding: 0 16px; }
.cc-head { height: 34px; background: var(--ink-100); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--fg3); }
.cc-row { min-height: 112px; border-top: 1px solid var(--line-1); color: var(--fg1); text-decoration: none;
  font-size: 13px; transition: background var(--dur-fast); }
.cc-row:hover { background: var(--ink-50); color: var(--fg1); }
.cc-wrap { position: relative; }   /* 수정·삭제 단추는 링크 위에 얹힌 형제(2026-09-15) */
.cc-actions { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.cc-thumb { width: 88px; height: 88px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); background: var(--ink-50); border: 1px solid var(--line-1); }
.cc-thumb img { width: 80px; height: 80px; }
.cc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sub { font-size: 12px; color: var(--fg3); }
.cc-unit { font-size: 11px; color: var(--fg3); margin-left: 2px; font-family: var(--font-sans); }
.cc-dim { color: var(--fg4); }
.cc-state { font-size: 12px; font-weight: 600; }
.cc-state.is-ok { color: var(--ok-600); } .cc-state.is-warn { color: var(--warn-600); }
.cc-state.is-crit { color: var(--crit-600); } .cc-state.is-offline { color: var(--fg3); }
/* 칸 너비 조절(assets/74_cc_resize.js, 2026-09-30) — 손잡이는 칸 사이 틈(12px) 한가운데 */
.cc-scroll { overflow-x: auto; }
.cc-head > span { position: relative; white-space: nowrap; }
.cc-row > * { min-width: 0; }
.cc-row > .ds-mono, .cc-row > .cc-state, .cc-row > .ws-pips { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cc-rz { position: absolute; top: -9px; bottom: -9px; right: -10px; width: 9px; cursor: col-resize; touch-action: none; }
.cc-rz::after { content: ""; position: absolute; top: 9px; bottom: 9px; left: 4px; width: 1px; background: var(--line-2); }
.cc-rz:hover::after { left: 3px; width: 3px; border-radius: 999px; background: var(--blue-500); }
body.cc-resizing, body.cc-resizing * { cursor: col-resize !important; user-select: none; }
@media (max-width: 1100px) {
  .cc-head, .cc-row { grid-template-columns: 88px minmax(0, 1fr) 84px 20px !important; }
  .cc-head > :nth-child(n+4):not(:last-child), .cc-row > :nth-child(n+4):not(:last-child) { display: none; }
  .cc-head, .cc-wrap { min-width: 0 !important; }   /* 줄인 배치에서는 너비 조절 없음 */
  .cc-rz { display: none; }
}

/* 모델링 편집기 (monitor/content/concrete.py, 9/11) */
.app-shell .mdl-seg { display: inline-flex; align-items: center; gap: 6px; }
.app-shell .mdl-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.app-shell .mdl-err { margin-right: auto; font-size: 12.5px; color: var(--crit-600); }
.app-shell .mdl-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--ok-600); background: var(--ok-50); padding: 3px 10px; border-radius: 999px; }
.app-shell .mdl-stats { display: flex; flex-wrap: wrap; gap: 28px; padding: 2px 4px 12px; min-height: 44px; }
.app-shell .mdl-val { font-size: 18px; font-weight: 600; color: var(--fg1); margin-top: 2px; }
.app-shell .mdl-unit { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--fg3); }
.app-shell .mdl-view { height: auto; min-height: 900px; }   /* 높이는 그림 layout.height(900) 이 정한다 — 2026-09-12 */
@media (max-width: 900px) { .app-shell .mdl-view { min-height: 900px; } }
/* 센서 배치(/sensor) 9/12 — 목록 행: 점 · 장치 Ch · 좌표 · 연필/휴지통 */
.app-shell .sn-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--fg1); }
.app-shell .sn-row + .sn-row { border-top: 1px solid var(--line-1); }
.app-shell .sn-row:hover { background: var(--ink-50); }
.app-shell .sn-row.is-active { background: var(--blue-50); }
.app-shell .sn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-500); flex: none; }
.app-shell .sn-row.is-active .sn-dot { background: var(--warn-500); }
.app-shell .sn-id { flex: 1; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.app-shell .sn-pos { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg3); white-space: nowrap; }
.app-shell .sn-act { display: flex; gap: 2px; opacity: .45; transition: opacity var(--dur-fast); }
.app-shell .sn-row:hover .sn-act, .app-shell .sn-row.is-active .sn-act { opacity: 1; }
.app-shell .sn-act button { padding: 3px 6px !important; }
.app-shell .sn-mode { min-height: 0; font-size: 12.5px; font-weight: 600; color: var(--blue-700); margin-bottom: 8px; }
.app-shell .sn-mode:empty { display: none; }
/* 단계 표시줄 콘크리트 이름(전환 드롭다운 폐지 9/12) */
.app-shell .ws-name { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; font-size: 13.5px; font-weight: 600; color: var(--fg1); }
/* 분석 실행(/control_analysis) 9/12 — 상태 칩 · 진행 로그 · 간격 잠금 */
.app-shell .ca-chip { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.app-shell .ca-chip.is-ok { background: var(--ok-50); color: var(--ok-600); }
.app-shell .ca-chip.is-warn { background: var(--warn-50); color: var(--warn-600); }
.app-shell .ca-chip.is-crit { background: var(--crit-50); color: var(--crit-600); }
.app-shell .ca-chip.is-offline { background: var(--ink-100); color: var(--ink-600); }
.app-shell .ca-log { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; max-height: 360px; overflow-y: auto;
  background: var(--ink-50); border: 1px solid var(--line-1); border-radius: var(--r-sm); padding: 8px 12px; color: var(--fg2); }
.app-shell .ca-line.is-done { color: var(--ok-600); }
.app-shell .ca-line.is-start { color: var(--fg3); font-weight: 600; margin-top: 4px; }
.app-shell .ca-line.is-err { color: var(--crit-600); }
.app-shell .ca-line.is-dim { color: var(--fg4); }
.app-shell .ca-progress { font-size: 11.5px; color: var(--fg3); }
.app-shell .ca-lock { pointer-events: none; opacity: .55; }
/* 분석 진행 막대(진행 로그 위) 9/12 */
.app-shell .ca-prog { margin: 2px 2px 10px; }
.app-shell .ca-prog__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.app-shell .ca-prog__label { font-size: 12.5px; font-weight: 600; color: var(--fg1); }
.app-shell .ca-prog__pct { font-size: 12px; color: var(--fg2); }
.app-shell .ca-bar { height: 8px; border-radius: 999px; background: var(--ink-100); overflow: hidden; }
.app-shell .ca-bar__fill { height: 100%; border-radius: 999px; background: var(--blue-500); transition: width var(--dur-fast); }
.app-shell .ca-bar__fill.is-done { background: var(--ok-500); }
.app-shell .ca-prog__stages { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--fg3); }
.app-shell .ca-prog__stage.is-done { color: var(--ok-600); }
.app-shell .ca-prog__k { margin-right: 4px; font-weight: 600; }

/* 트랜스포트 바(analysis_controls.css 에서 이사, 9/12 — 결과 화면 타임라인) */
.app-shell .an-transport { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--ink-50);
  border: 1px solid var(--line-1); border-radius: var(--r-md); margin-bottom: 12px; }
.app-shell .an-transport .an-slider-wrap { flex: 1 1 auto; min-width: 0; padding: 0 8px; }
.app-shell .an-transport .rc-slider { margin: 0; }
.app-shell .an-readout { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--fg2); white-space: nowrap; }
.app-shell .an-tbtn.btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--line-2); background: #fff; color: var(--fg2); box-shadow: none; }
.app-shell .an-tbtn.btn:hover { background: var(--ink-50); color: var(--fg1); }
.app-shell .an-tbtn--play.btn { background: var(--blue-500); border-color: transparent; color: #fff; }
.app-shell .an-tbtn--play.btn:hover { background: var(--blue-600); color: #fff; }
.app-shell .an-tbtn.btn:disabled { background: var(--ink-100); color: var(--fg4); border-color: transparent; }
/* 결과 화면(/result) 9/12 — 셸 사슬(shell-content → shell-page → rs-page)을 flex 로 이어 격자가 남은 높이를 다 쓴다(고정 px 없음).
   «확대»(body.rs-wide)는 제목 바·단계 표시줄을 숨겨 그만큼 격자가 커진다. */
.app-shell .shell-content:has(.rs-page) { display: flex; flex-direction: column; }
/* shell-content 와 rs-page 사이의 모든 상자(#_pages_content·shell-page…)를 flex 로 잇는다 — 렌더러엔 없던 _pages_content 가 실제엔 있어 못 채웠다(9/12) */
.app-shell .shell-content *:has(.rs-page) { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; display: flex; flex-direction: column; }
.app-shell .shell-page:has(.rs-page) { max-width: none; }   /* 상한 없음 — 결과 그래프가 화면 폭을 다 쓴다(9/13) */
.app-shell .rs-page { flex: 1 1 auto; min-height: 480px; display: flex; flex-direction: column; }
body.rs-wide .topbar, body.rs-wide .ws { display: none; }
body.rs-wide #rs-zoom { background: var(--blue-50); color: var(--blue-700); }
/* 몸통 = 왼쪽 세로 열(KPI + 색 범위·내보내기·확대) + 두 장 */
.app-shell .rs-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 12px; }
.app-shell .rs-side { flex: none; width: 184px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; overflow: auto;
  background: #fff; border: 1px solid var(--line-1); border-radius: var(--r-md); }
/* KPI = 통계 타일(mdl-stat) 세로 쌓기(9/13) — 라벨 위, 값 아래, 얇은 구분선. 값은 산세리프·비례 숫자(큰 단독 숫자에 tabular 는 헐렁하다) */
.app-shell .rs-kpi { display: flex; flex-direction: column; }
.app-shell .rs-kpi .mdl-stat { padding: 8px 0; border-bottom: 1px solid var(--line-1); }
.app-shell .rs-kpi .mdl-stat:last-child { border-bottom: 0; }
.app-shell .rs-kpi .mdl-val { font-size: 20px; line-height: 1.15; white-space: nowrap; font-variant-numeric: normal; }
.app-shell .rs-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line-1); }
.app-shell .rs-side__foot .ds-segmented { flex-wrap: wrap; }
.app-shell .rs-side__foot .ds-segmented label { padding: 4px 8px; white-space: nowrap; }
.app-shell .rs-side__row { display: flex; gap: 6px; }
.app-shell .rs-side__row > * { flex: 1 1 0; justify-content: center; white-space: nowrap; }
.app-shell .rs-toolbar { margin-bottom: 10px; }
.app-shell .rs-toolbar .an-transport { margin-bottom: 0; flex-wrap: wrap; }
.app-shell .rs-toolbar .an-slider-wrap { flex-basis: 200px; }
.app-shell .rs-sub { display: none; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.app-shell .rs-toolbar.is-cut .rs-sub, .app-shell .rs-toolbar.is-node .rs-sub { display: flex; }
.app-shell .rs-ctl { display: none; align-items: center; gap: 10px; }
.app-shell .rs-toolbar.is-cut .rs-ctl--cut, .app-shell .rs-toolbar.is-node .rs-ctl--node { display: flex; flex-wrap: wrap; }
.app-shell .rs-page:has(.rs-toolbar.is-node) .rs-range { display: none; }   /* 노드 보기엔 색 범위 없음 */
.app-shell .rs-cut-slider { width: 220px; padding: 0 8px; }
.app-shell .rs-cut-slider .rc-slider { margin: 0; }
.app-shell .rs-mini { width: 160px; height: 130px; }   /* 왼쪽 열 안폭(184 - 12·2) */
.app-shell .rs-locator { margin-top: 4px; }
.app-shell .rs-page:has(.rs-toolbar.is-3d) .rs-locator { display: none; }   /* 위치 표시는 단면·노드 보기에서만 */
.app-shell .rs-slot { display: inline-flex; align-items: center; gap: 6px; }
.app-shell .rs-slot__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.app-shell .rs-slot__k { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--fg2); }
.app-shell .rs-grid-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }   /* dcc.Loading 겉·속 div 둘 다 */
/* 한 줄에 두 장(9/12) */
.app-shell .rs-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); gap: 12px; }
.app-shell .rs-grid.is-1col { grid-template-columns: minmax(0, 1fr); }   /* «1열» = 왼쪽 한 장만 크게(기본, 9/14) */
.app-shell .rs-grid.is-1col .rs-panel:nth-child(2) { display: none; }
.app-shell .rs-panel { min-height: 0; display: flex; flex-direction: column; }
.app-shell .rs-panel > .ds-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }   /* ui.card 는 <section> — 퍼센트 높이 안 씀 */
.app-shell .rs-panel .ds-card__head { padding: 4px 12px !important; flex: none; }
.app-shell .rs-panel .ds-card__title { font-weight: 500; }   /* 제목 = 종목 고르개 */
.app-shell .rs-panel .ds-card__body { flex: 1 1 auto; min-height: 0; position: relative; }
/* dcc.Graph 은 인라인 height:100% 인데 flex 사슬에선 퍼센트가 안 풀려 Plotly 기본 450px 로 커지고 카드가 아래를 잘랐다(9/12 실측).
   절대 배치는 담는 상자 크기를 그대로 받는다. */
.app-shell .rs-panel .rs-graph { position: absolute; inset: 0; }
@media (max-width: 1100px) {   /* 좁은 화면은 세로 스크롤, 한 열 */
  .app-shell .shell-content:has(.rs-page), .app-shell .shell-content *:has(.rs-page), .app-shell .rs-page { display: block; height: auto; }
  .app-shell .rs-body { display: block; }
  .app-shell .rs-side { width: auto; flex-direction: row; flex-wrap: wrap; margin-bottom: 12px; }
  .app-shell .rs-kpi { flex-direction: row; flex-wrap: wrap; gap: 6px 20px; }
  .app-shell .rs-kpi .mdl-stat { padding: 0; border-bottom: 0; }   /* 가로로 흐를 땐 구분선 없음 */
  .app-shell .rs-side__foot { margin-top: 0; flex-direction: row; border-top: 0; padding-top: 0; }
  .app-shell .rs-grid { grid-template-columns: 1fr; grid-template-rows: none; }
    .app-shell .rs-panel .ds-card__body { height: 340px; }
}
}

/* 알람 규칙 목록(/alarm_create) — 센서 목록 행(.sn-row)을 그대로 쓰고 점 색만 심각도 */
.app-shell .sn-dot.is-warn { background: var(--warn-500); }
.app-shell .sn-dot.is-crit { background: var(--crit-500); }
.app-shell .sn-dot.is-off { background: var(--ink-300); }
.app-shell .ar-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-shell .ar-name { font-size: 12.5px; font-weight: 600; color: var(--fg1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .ar-row .sn-pos { white-space: normal; }

/* 설명자료(/docs) — 논문 조판: 왼쪽 차례(고정), 오른쪽 본문. 수식은 dcc.Markdown(mathjax) */
.app-shell .doc-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.app-shell .doc-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 12px 6px; }
.app-shell .doc-toc a { display: block; padding: 6px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--fg2); text-decoration: none; border-left: 2px solid transparent; }
.app-shell .doc-toc a:hover { background: var(--ink-50); color: var(--fg1); }
.app-shell .doc-toc a.is-sub { padding-left: 22px; font-size: 12px; color: var(--fg3); }
.app-shell .doc-toc .doc-toc__label { padding: 4px 10px 8px; }
.app-shell .doc-article { background: #fff; border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 44px 56px 56px; max-width: 960px; }
.app-shell .doc-head { border-bottom: 1px solid var(--line-1); padding-bottom: 22px; margin-bottom: 30px; }
.app-shell .doc-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 6px 0 8px; color: var(--fg1); }
.app-shell .doc-head .doc-meta { font-size: 12.5px; color: var(--fg3); display: flex; gap: 14px; flex-wrap: wrap; }
.app-shell .doc-abstract { background: var(--ink-50); border-left: 3px solid var(--blue-500); border-radius: var(--r-sm); padding: 14px 18px; font-size: 13.5px; line-height: 1.75; color: var(--fg2); margin: 16px 0 0; }
.app-shell .doc-sec { scroll-margin-top: 84px; padding-top: 8px; }
.app-shell .doc-sec + .doc-sec { margin-top: 36px; border-top: 1px dashed var(--line-1); padding-top: 30px; }
.app-shell .doc-md { font-size: 14px; line-height: 1.85; color: var(--fg1); }
.app-shell .doc-md h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: var(--fg1); display: flex; gap: 10px; align-items: baseline; }
.app-shell .doc-md h2 .doc-num, .app-shell .doc-md h3 .doc-num { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--blue-600); }
.app-shell .doc-md h3 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; color: var(--fg1); }
.app-shell .doc-md p { margin: 0 0 12px; text-align: justify; word-break: keep-all; }
.app-shell .doc-md ul, .app-shell .doc-md ol { margin: 0 0 12px; padding-left: 22px; }
.app-shell .doc-md li { margin: 2px 0; }
.app-shell .doc-md table { border-collapse: collapse; width: 100%; margin: 10px 0 18px; font-size: 12.5px; }
.app-shell .doc-md th { text-align: left; font-weight: 600; color: var(--fg2); background: var(--ink-50); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 7px 10px; }
.app-shell .doc-md td { border-bottom: 1px solid var(--line-1); padding: 7px 10px; vertical-align: top; }
.app-shell .doc-md code { font-family: var(--font-mono); font-size: 12px; background: var(--ink-50); border-radius: 4px; padding: 1px 5px; color: var(--fg1); }
.app-shell .doc-md pre { background: var(--ink-50); border: 1px solid var(--line-1); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.6; }
.app-shell .doc-md pre code { background: none; padding: 0; }
.app-shell .doc-md blockquote { margin: 12px 0 16px; padding: 10px 16px; border-left: 3px solid var(--warn-500); background: var(--warn-50); color: var(--fg2); font-size: 13px; border-radius: var(--r-sm); }
.app-shell .doc-md blockquote p { margin: 0; }
.app-shell .doc-md mjx-container[display="true"] { margin: 10px 0 16px !important; overflow-x: auto; overflow-y: hidden; }
.app-shell .doc-md .doc-eq { font-size: 12px; color: var(--fg3); }
.app-shell .doc-ref { font-size: 12.5px; color: var(--fg2); }
.app-shell .doc-ref li { margin: 4px 0; }
@media (max-width: 1100px) { .app-shell .doc-wrap { grid-template-columns: 1fr; } .app-shell .doc-toc { position: static; flex-direction: row; flex-wrap: wrap; } .app-shell .doc-article { padding: 28px 22px; } }

/* 사용자 가이드 화면 그림(9/14) */
.app-shell .doc-md img { display: block; max-width: 100%; margin: 14px 0 4px; border: 1px solid var(--ink-100); border-radius: var(--r-sm); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.app-shell .doc-md img + p > em { display: block; font-size: 12px; color: var(--fg3); margin-bottom: 18px; }
.app-shell .ca-prog__stage.is-active { color: var(--blue-600); font-weight: 700; }

/* ---- 전역 로딩 스피너 (assets/66_loading.js, 2026-09-30) ----
   body.shms-busy = 콜백 대기 0.3초 초과. ._dash-loading = 첫 진입 때 Dash 가 넣는 «Loading...» 글자 자리 */
@keyframes shms-spin { to { transform: rotate(360deg); } }
body.shms-busy::after, ._dash-loading::after {
  content: ""; position: fixed; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; border: 3px solid var(--ink-200); border-top-color: var(--blue-500);
  background: rgba(255,255,255,.9); box-shadow: 0 0 0 8px rgba(255,255,255,.9);
  animation: shms-spin .7s linear infinite; z-index: 2000; pointer-events: none;
}
body.shms-busy:has(.sidebar)::after { left: calc(50% + 110px); }   /* 사이드바(220px)를 뺀 본문 한가운데 */
@media (max-width: 900px) { body.shms-busy:has(.sidebar)::after { left: calc(50% + 32px); } }
._dash-loading { font-size: 0; }
