:root {
  --sims-modal-header-bg: #dfe1e3;
  --sims-modal-footer-bg: #d9dce0;
  --sims-modal-edge-border: #e2e8f0;
  /* 메인 테마 등 설정 메뉴 열 최대 가로 (좌측 패널 디폴트 = 이 값 × 1.5) */
  --sims-setting-menu-max-width: 300px;
  /* 미리보기 좌측 액션 버튼 가로 — 안내 텍스트 폭 = 이 값 × 2.5 */
  --sims-widget-preview-action-btn-width: 138px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

/* ── 헤더 (asset_setting과 동일) ── */
.app-header.regi-header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* ins_main .header-left { flex-direction: column } 보다 우선: 로고와 로그아웃을 한 줄(가로)로 */
.app-header.regi-header-layout .header-left {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}
.app-header.regi-header-layout .header-left .logo-link {
  display: flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}
.app-header.regi-header-layout .header-left .logo-link img {
  height: 78px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.app-header.regi-header-layout .header-left .logo-link .logo-tagline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 78px;
  gap: 2px;
  margin-left: 0;
}
.app-header.regi-header-layout .header-left .logo-link .logo-tagline .tagline-sub {
  font-size: 14.95px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  text-align: center;
}
.app-header.regi-header-layout .header-left .logo-link .logo-tagline .tagline-main {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  text-align: center;
}
/* sims_region_persons 로그인: 로고 우측 로그아웃(녹색), 세로 크기는 뒤로가기의 2/3(JS로 동기화) */
.app-header.regi-header-layout .header-left .btn-region-person-logout {
  margin-left: 0;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  padding: 0 12px;
  color: #ecfdf5;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.35);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.app-header.regi-header-layout .header-left .btn-region-person-logout:hover {
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.45);
  transform: translateY(-1px);
}
.app-header.regi-header-layout .header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.app-header.regi-header-layout .header-center .regi-page-title {
  font-size: 34px;
  font-weight: 600;
  color: #2563eb;
  margin: 0;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
}
.asset-header-right .btn-primary {
  font-size: 17px;
  padding: 11px 21px;
}
.screen-help-inquiry-wrap {
  display: none;
}
.screen-help-video-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #eff6ff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  font-size: 20px;
  flex-shrink: 0;
}
.screen-help-video-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}
#screenHelpVideoModal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 10070;
  padding: 0;
}
#screenHelpVideoModal.is-open { display: flex; }
#screenHelpVideoModal .screen-help-video-dialog {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#screenHelpVideoModal .screen-help-video-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #dfe1e3;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
#screenHelpVideoModal .screen-help-video-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
#screenHelpVideoModal .screen-help-video-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* 마을공지 테마: 단계 1 안내 위 「사용 절차」(헤더 비밀번호 변경과 동일 크기, 녹색) */
.notice-usage-procedure-wrap {
  margin-bottom: 10px;
}
.btn-primary.btn-primary--notice-procedure {
  font-size: 17px;
  padding: 11px 21px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ecfdf5;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}
.btn-primary.btn-primary--notice-procedure:hover {
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.45);
}

/* 마을공지 사용 절차 모달 (region_noti_how_to_use.md → Markdown 렌더) */
.region-noti-howto-modal.sims-modal {
  width: 100%;
  max-width: min(840px, calc(100vw - 32px));
}
.region-noti-howto-body {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 4px 4px 8px;
  margin: 0 -4px;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  -webkit-overflow-scrolling: touch;
}
.region-noti-howto-body h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.region-noti-howto-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 20px 0 10px;
}
.region-noti-howto-body h2:first-of-type {
  margin-top: 0;
}
.region-noti-howto-body hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}
.region-noti-howto-body p {
  margin: 0 0 10px;
}
.region-noti-howto-body ol,
.region-noti-howto-body ul {
  margin: 8px 0 12px;
  padding-left: 1.35em;
}
.region-noti-howto-body li {
  margin: 6px 0;
}
.region-noti-howto-body strong {
  color: #0f172a;
  font-weight: 600;
}
.region-noti-howto-body blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 4px solid #86efac;
  background: #f0fdf4;
  color: #14532d;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}
.region-noti-howto-body blockquote p:last-child {
  margin-bottom: 0;
}
.region-noti-howto-loading,
.region-noti-howto-error {
  text-align: center;
  color: #64748b;
  padding: 16px 8px;
}
.region-noti-howto-error {
  color: #b91c1c;
}
.region-noti-howto-fallback {
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 마을공지 적용 OTP 모달: 검증 실패 시 QR 아래 'OTP 화면 표시' */
.notice-apply-otp-direct-wrap {
  margin-top: 14px;
  text-align: center;
}
.notice-apply-otp-direct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 10px 16px !important;
  font-size: 14px;
}

/* (모바일 CSS는 파일 맨 끝에 위치 — 기본 스타일보다 나중에 선언해야 cascade 우선순위 확보) */

/* ── 화면 구성 버튼 그리드: PC에서 숨김 (미디어 쿼리보다 먼저 선언해야 cascade 올바름) ── */
.mobile-compose-btn-grid { display: none; }

/* ── 바디 레이아웃 ── */
.screen-body {
  position: fixed;
  top: var(--header-height, 90px);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ── 좌측 설정 패널 ── */
.screen-left {
  display: flex;
  flex-direction: column;
  min-width: 260px;
  overflow: hidden;
  background: #f8fafc;
  border-right: none;
}
.screen-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  /* 설정 / 화면 구성 타이틀 행 높이 통일 (패딩 + 한 줄 기준) */
  min-height: 52px;
  padding: 16px 20px 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  background: #fff;
}
/* 우측: 제목·안내 한 줄, 좌측 헤더와 동일 높이(세로 가운데 정렬) */
.screen-right .screen-panel-header--compose {
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: visible;
}
.screen-right .screen-panel-header--compose .screen-panel-header-title {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: #1e293b;
}
.screen-right .screen-panel-header--compose .screen-panel-header-sub {
  flex-shrink: 0;
  margin: 0 0 0 0.45em;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  color: #94a3b8;
}
.screen-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 0;
}

/* ── 스플리터 ── */
.screen-splitter {
  flex: 0 0 6px;
  width: 6px;
  min-width: 6px;
  align-self: stretch;
  cursor: col-resize;
  background: #cbd5e1;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s;
}
.screen-splitter:hover,
.screen-splitter:focus {
  background: #94a3b8;
  outline: none;
}
.screen-splitter.is-dragging {
  background: #64748b;
}
body.screen-split-active {
  cursor: col-resize !important;
  user-select: none;
}

/* ── 우측 미리보기 패널 ── */
.screen-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* flex: 긴 한 줄 헤더 때문에 열이 안 줄어드는 현상 방지 — 최소 너비는 스플리터(MIN_RIGHT)가 담보 */
  min-width: 0;
  overflow-x: visible;
  overflow-y: hidden;
  background: #f1f5f9;
}
.screen-preview-body {
  flex: 1;
  /* 스크롤바 on/off로 clientWidth가 출렁이며 resizeWidget 루프(떨림) 나는 것 방지 */
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.screen-compose-step-hint {
  margin: 0 0 16px 0;
  padding: 0 8px;
  width: 100%;
  max-width: 960px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: #475569;
  text-align: left;
  white-space: pre-line;
}
.screen-preview-placeholder {
  color: #94a3b8;
  font-size: 15px;
  margin-top: 60px;
  text-align: center;
}
.screen-preview-placeholder i {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  color: #cbd5e1;
}

/* ── 위젯 미리보기 ── */
.widget-preview-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px 16px 16px;
  box-sizing: border-box;
}
.compose-no-phone-frame .widget-preview-preview-cluster { display: none !important; }
.compose-no-phone-frame .screen-panel-header-sub { display: none !important; }
.compose-no-phone-frame .widget-preview-inner {
  justify-content: center;
}
.compose-no-phone-frame .phone-side-actions {
  align-items: center;
  align-self: center;
}
.compose-no-phone-frame .phone-side-actions .btn-with-info:not(#btnScheduleManageWrap) {
  display: none !important;
}
.compose-no-phone-frame .mobile-compose-btn-grid .btn-widget-action:not(#btnScheduleManage) {
  display: none !important;
}
@media (min-width: 769px) {
  .compose-no-phone-frame #btnScheduleManage {
    width: calc(var(--sims-widget-preview-action-btn-width) * 2);
    padding: 20px 0;
    font-size: 28px;
    line-height: 1.35;
    border-radius: 20px;
    gap: 14px;
  }
}
@media (max-width: 768px) {
  .compose-no-phone-frame .widget-preview-wrap { display: none !important; }
  .compose-no-phone-frame .mobile-compose-btn-grid {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
  }
  .compose-no-phone-frame .mobile-compose-btn-grid #btnScheduleManage {
    width: 50vw !important;
    max-width: 50vw !important;
    min-height: calc((9px * 2 + 12px * 1.3) * 2);
    padding: 18px 12px !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
    border-radius: 16px;
    gap: 10px;
  }
}

.widget-preview-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  width: 100%;
}
/* 좌측: 버튼들 + 안내 텍스트(세로) → 프레임 바로 왼쪽 */
.widget-preview-preview-cluster {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
}
.phone-frame-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
#weatherRealRenderRow {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  margin-bottom: 4px;
}
/* 열 폭 = 안내 텍스트(버튼 폭×2.5), 안·버튼 모두 프레임 쪽(오른쪽)으로 붙임 */
.phone-preview-left-stack {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  flex-shrink: 0;
  width: calc(var(--sims-widget-preview-action-btn-width) * 2.5);
  box-sizing: border-box;
}
.widget-preview-hints-inner {
  width: 100%;
  box-sizing: border-box;
  margin-top: 100px;
}
.widget-preview-hint-apply {
  font-weight: 700;
  font-size: 1.25em;
}
.widget-preview-hint_first {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #888;
  text-align: left;
}
.widget-preview-hint_next {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #888;
  text-align: left;
}
/* ── 스마트폰 좌·우측 액션 버튼 세로 배열 ── */
.phone-side-actions,
.phone-left-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
  flex-shrink: 0;
  align-self: stretch;
}
/* 화면 세로 크기 버튼: flex 컨테이너 하단으로 밀어냄 */
.btn-with-info--push-bottom {
  margin-top: auto !important;
}
/* PC: 위젯 박스 하단 중앙 버튼만 표시 / 모바일용 버튼 숨김 */
@media (min-width: 769px) {
  .screen-vertical-btn-mobile { display: none !important; }
}
/* 모바일: 위젯 박스 하단 중앙 버튼 숨김 / 모바일용 버튼만 표시 */
@media (max-width: 768px) {
  #screenVerticalBtnWrap { display: none !important; }
}
.phone-side-actions-gap-after-reset {
  width: var(--sims-widget-preview-action-btn-width);
  flex-shrink: 0;
  height: calc(10px * 2 + 14px * 1.35); /* 버튼 1개 높이 */
  pointer-events: none;
}
.phone-side-actions .btn-widget-action,
.phone-left-actions .btn-widget-action {
  width: var(--sims-widget-preview-action-btn-width);
}

/* ── ℹ 정보 아이콘 + 버튼 래퍼 ── */
.btn-with-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: fit-content;
}
.btn-with-info--left {
  flex-direction: row;        /* ℹ 먼저, 버튼 나중 */
}
.btn-with-info--right {
  flex-direction: row;        /* 버튼 먼저, ℹ 나중 */
}
.btn-info-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 17px;
  color: #2563eb;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s;
}
.btn-info-icon:hover {
  color: #1d4ed8;
}

/* ── 스마트폰 프레임 ── */
.phone-frame {
  display: inline-flex;
  flex-direction: column;
  background: #1c1c1e;
  border-radius: 40px;
  box-shadow:
    0 0 0 1px #3d3d3f,
    0 0 0 5px #2c2c2e,
    0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  flex-shrink: 0;
}
.phone-topbar {
  height: 46px;
  background: #1c1c1e;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding-bottom: 9px;
  flex-shrink: 0;
}
.phone-speaker-grill {
  width: 58px;
  height: 5px;
  border-radius: 3px;
  background: #3a3a3c;
}
.phone-camera-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2a2a2e;
  border: 1.5px solid #444;
}
.phone-screen {
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone-statusbar {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
.phone-statusbar-time {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0;
}
.phone-statusbar-icons {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
}
.phone-widget-slot {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
}
/* 항상 표시 원형 버튼 */
.always-display-btn {
  position: absolute;
  border-radius: 50%;
  background: #5b82d8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 10;
  cursor: default;
}
.always-display-btn__text {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  word-break: keep-all;
  padding: 2px;
}
.always-display-btn__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* 위젯 박스 아래: 수신 알림 — 가로 2개, flow 높이 비가산(absolute). top은 sims_screen resizeWidget에서 위젯 하단에 맞춤 */
.phone-widget-subscribe-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  gap: 4px;
  padding: 0 4px;
  margin: 0;
  flex-wrap: nowrap;
  pointer-events: auto;
  z-index: 2;
}
.phone-subscribe-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 4px;
}
.phone-subscribe-wrap .phone-subscribe-label {
  flex: 0 1 auto;
}
.phone-subscribe-info-btn {
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}
.phone-subscribe-info-btn:hover {
  color: #fff;
}
.phone-subscribe-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
#weatherRealRenderRow .phone-subscribe-label {
  color: #111;
}
#weatherRealRenderRow .phone-subscribe-info-btn {
  color: #3b82f6;
}
#weatherRealRenderRow .phone-subscribe-info-btn:hover {
  color: #1d4ed8;
}
.phone-subscribe-label span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-subscribe-label input[type="checkbox"] {
  width: 26px;
  height: 26px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #38bdf8;
}
.phone-appgrid {
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.phone-approw {
  display: flex;
  justify-content: space-evenly;
}
.phone-appicon {
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.phone-bottombar {
  height: 38px;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-shrink: 0;
}
.phone-nav-btn {
  color: rgba(255, 255, 255, 0.75);
  font-size: 20px;
  line-height: 1;
  user-select: none;
}
.btn-widget-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 140px;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}
.btn-widget-action:active { transform: scale(0.97); }
.btn-apply-now {
  background: #2563eb;
  color: #fff;
}
.btn-apply-now:hover { background: #1d4ed8; }
.btn-temp-save {
  background: #ffffff;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.btn-temp-save:hover { background: #f0fdf9; }
.btn-fav-add-direct {
  background: #ffffff;
  color: #7c3aed;
  border: 1px solid #c4b5fd;
}
.btn-fav-add-direct:hover { background: #faf5ff; }
.btn-add-fav {
  background: #ffffff;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.btn-add-fav:hover { background: #fef9ee; }
.btn-media-manage {
  background: #ffffff;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}
.btn-media-manage:hover { background: #f5f3ff; }
.btn-schedule-manage {
  background: #16a34a;
  color: #fff;
  border: none;
}
.btn-schedule-manage:hover { background: #15803d; }
.btn-reset-widget {
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.btn-reset-widget:hover { background: #fff1f2; }
#btnPhonebookWrap {
  margin-top: calc(20px + 14px * 1.35 + 10px); /* 버튼 1개 높이 + gap */
}
.btn-phonebook {
  background: #ffffff;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.btn-phonebook:hover { background: #f0f9ff; }
.btn-preview {
  background: #ffffff;
  color: #0f766e;
  border: 1px solid #5eead4;
}
.btn-preview:hover { background: #f0fdfa; }
.btn-screen-vertical-size {
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  flex-direction: column;
  padding: 8px 6px;
  gap: 0;
}
.btn-screen-vertical-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}
.btn-screen-vertical-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-screen-vertical-sublabel {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e40af;
  opacity: 0.92;
}
.btn-screen-vertical-size:hover { background: #eff6ff; }

/* ── 즐겨찾기 모달 ── */
.fav-modal {
  width: 420px;
  max-width: 96vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.fav-modal-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px dashed #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 14px;
}
.fav-modal-add-btn:hover { background: #dbeafe; }
.fav-list-header {
  display: flex;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 2px;
}
.fav-col-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fav-col-count {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 68px;
  text-align: center;
}
.fav-col-action {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 32px;
  text-align: center;
}
.fav-list {
  flex: 1;
  overflow-y: auto;
  min-height: 60px;
}
.fav-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 28px 0;
}
.fav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.fav-item:last-child { border-bottom: none; }
.fav-item--recent {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
}
.fav-item--recent .fav-item-name {
  color: #15803d;
  cursor: default;
}
.fav-item--recent .fav-item-name:hover { color: #15803d; }
.fav-item--recent .btn-more:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.fav-item--temp {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}
.fav-item--temp .fav-item-name {
  color: #92400e;
  cursor: default;
}
.fav-item--temp .fav-item-name:hover { color: #92400e; }
.fav-item--selectable {
  cursor: pointer;
}
.fav-item--selectable:hover {
  filter: brightness(0.96);
}
.fav-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.fav-item-name:hover { color: #2563eb; }
.fav-item-count {
  font-size: 13px;
  color: #64748b;
  width: 68px;
  text-align: center;
  white-space: nowrap;
}
/* 세로점 메뉴 (asset_update_item.html과 동일 스타일) */
.fav-action-menu {
  position: relative;
  display: inline-block;
}
.fav-action-menu .btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #64748b;
  border-radius: 4px;
}
.fav-action-menu .btn-more:hover {
  background: #f3f4f6;
  color: #111827;
}
.fav-action-menu .action-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 120px;
  background: #111827;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 4px 0;
  z-index: 20;
  display: none;
}
.fav-action-menu .action-menu-dropdown.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.fav-action-menu .action-menu-item {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 13px;
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
}
.fav-action-menu .action-menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(249, 250, 251, 0.12);
}
.fav-action-menu .action-menu-item:hover {
  background: rgba(55, 65, 81, 0.85);
  color: #f9fafb;
}
.fav-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.fav-modal-footer .btn-fav-close {
  padding: 8px 22px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
/* ── 즐겨찾기 이름 입력 커스텀 모달 ── */
.fav-name-modal {
  width: 340px;
  max-width: 96vw;
}
.fav-name-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  margin: 8px 0 16px;
}
.fav-name-input:focus { border-color: #2563eb; }
.fav-name-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.fav-name-footer .btn-fav-name-cancel {
  padding: 8px 20px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.fav-name-footer .btn-fav-name-ok {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.sims-modal-overlay .fav-name-modal > h2.sims-modal-title + .fav-name-input {
  margin: 20px 0 16px;
}

.widget-box {
  /* 가로/높이는 JS ResizeObserver로 동적 설정 (항상 4:3 비율) */
  width: 200px;
  height: 150px;
  min-width: 200px;
  min-height: 150px;
  flex-shrink: 0;
  border-radius: 0;
  border: none;
  position: relative;
  background: #ffffff;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── 설정 메뉴 버튼 (한 열 너비를 300px로 고정해 들여쓰기 단계와 무관하게 우측 정렬) ── */
.setting-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: var(--sims-setting-menu-max-width);
  box-sizing: border-box;
}
.setting-menu-intro-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 2px 2px;
  max-width: 100%;
  box-sizing: border-box;
}
.setting-menu-intro {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: #475569;
}
.setting-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: background 0.15s, border-color 0.15s;
}
.setting-menu-btn:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
}
.setting-menu-btn i {
  font-size: 18px;
  color: #2563eb;
  width: 22px;
  text-align: center;
}

/* ── 마을 공지: 관할 마을(region_name) 타일 목록 (지자체 담당 person_type=2) ── */
.region-notice-village-list-wrap {
  width: 100%;
  max-width: var(--sims-setting-menu-max-width);
  box-sizing: border-box;
  padding: 10px 12px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.region-notice-village-hint {
  margin: 0 0 10px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: #64748b;
}
.region-notice-village-list-header {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
.region-notice-village-action-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.region-notice-village-action-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.region-notice-village-action-btn--secondary {
  background: #fff;
  color: #2563eb;
  border-color: #93c5fd;
}
.region-notice-village-action-btn--secondary:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}
.region-notice-village-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.region-notice-village-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.region-notice-village-list--tiles {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow-x: hidden;
}
.region-notice-village-item {
  margin: 0;
  padding: 0;
  list-style: none;
}
.region-notice-village-item + .region-notice-village-item {
  border-top: 1px solid #e2e8f0;
}
.region-notice-village-tile {
  display: block;
  position: relative;
  margin: 0;
  padding: 11px 14px;
  cursor: pointer;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
  transition: background 0.12s ease, color 0.12s ease;
}
.region-notice-village-tile:hover {
  background: #f8fafc;
}
.region-notice-village-cb--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.region-notice-village-tile-text {
  display: block;
}
/* 선택됨: 파란 배경 (클래스 + :has 폴백) */
.region-notice-village-tile.region-notice-village-tile--selected,
.region-notice-village-tile:has(.region-notice-village-cb:checked) {
  background: #2563eb;
  color: #fff;
}
.region-notice-village-tile.region-notice-village-tile--selected:hover,
.region-notice-village-tile:has(.region-notice-village-cb:checked):hover {
  background: #1d4ed8;
  color: #fff;
}
.region-notice-village-tile:focus-within {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
  z-index: 1;
}
.region-notice-village-empty {
  font-size: 13px;
  color: #64748b;
  padding: 12px 14px;
  margin: 0;
  list-style: none;
}

/* ── 모달 오버레이 ── */
.sims-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9000;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}
.sims-modal-overlay.active {
  display: flex;
}
.sims-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.18);
  padding: 28px 28px 22px;
  width: 440px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto;
}
.sims-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

/* ── sims_screen 모든 모달: 헤더/푸터 배경 구분 (콘트롤 설정과 동일 톤) ── */
.sims-modal-overlay .sims-modal {
  gap: 0;
}
/* 기본 패딩 28px 모달 — 제목 h2 + 하단 sims-modal-footer */
.sims-modal-overlay .sims-modal > h2.sims-modal-title:first-child {
  margin: -28px -28px 0 -28px;
  padding: 28px 28px 16px 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
}
.sims-modal-overlay .sims-modal > h2.sims-modal-title:first-child + * {
  margin-top: 20px;
}
.sims-modal-overlay .sims-modal > .sims-modal-footer {
  margin: 20px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}
/* 즐겨찾기 — 목록 푸터 */
.sims-modal-overlay .fav-modal > .fav-modal-footer {
  margin: 12px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}
/* 즐겨찾기 이름 */
.sims-modal-overlay .fav-name-modal > .fav-name-footer {
  margin: 16px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}
/* 전화 버튼/미디어 설정 — phone-cfg-header · footer (콘트롤 탭 모달 제외) */
.sims-modal-overlay .sims-modal:not(.sims-control-settings-modal) .phone-cfg-header {
  margin: -28px -28px 0 -28px;
  padding: 28px 28px 12px 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
}
.sims-modal-overlay .sims-modal:not(.sims-control-settings-modal) .phone-cfg-header + .modal-form-row {
  margin-top: 20px;
}
.sims-modal-overlay .sims-modal:not(.sims-control-settings-modal) .phone-cfg-footer {
  margin: 20px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}

/* 임시 비밀번호 → 정식 (sims_login 경유 후 sims_screen에서 모달) */
#regionTempPwdModalOverlay .region-temp-pwd-hint {
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  margin: 20px 0 16px 0;
}
.phone-cfg-modal .modal-textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.phone-cfg-modal .modal-textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35);
}

/* 마을공지 입력 모달 — 즉시/예약 세그먼트 (sims_schedule 일정 추가 탭과 유사 톤) */
#noticeInputModalBox .phone-cfg-body.notice-input-modal-body {
  margin-top: 20px;
}
.notice-input-modal-body {
  width: 100%;
  box-sizing: border-box;
}
.notice-mode-panels-wrap {
  width: 100%;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
  box-sizing: border-box;
}
#noticeInputModalBox .notice-mode-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  box-sizing: border-box;
}
#noticeImmediatePanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 예약 공지의 날짜·시간 블록과 동일한 세로 영역(JS로 높이 동기화) → 공지 내용 입력란 높이 일치 */
#noticeImmediatePanel .notice-immediate-top-spacer {
  flex: 0 0 auto;
  min-height: 0;
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;
}
#noticeImmediatePanel .notice-immediate-content-field {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}
#noticeImmediatePanel .notice-immediate-content-field .modal-textarea {
  flex: 1 1 auto;
  min-height: 0;
}
#noticeScheduledPanel {
  display: none;
  gap: 12px;
}
#noticeInputModalBox .sms-settings-label-row {
  flex-shrink: 0;
}
#noticeInputModalBox .sms-settings-label-row label {
  display: inline;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}
#noticeInputModalBox .notice-modal-textarea--fill {
  flex: 1 1 auto;
  min-height: 0;
  resize: none;
  width: 100%;
}
#noticeScheduledPanel .notice-scheduled-fields {
  flex: 0 0 auto;
}
#noticeScheduledPanel .notice-scheduled-content-field {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
}
#noticeScheduledPanel .notice-scheduled-content-field .modal-textarea {
  flex: 1 1 auto;
  min-height: 0;
}
.notice-mode-segment {
  display: flex;
  width: 100%;
  margin-bottom: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}
.notice-mode-segment__btn {
  flex: 1;
  padding: 12px 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  background: #fff;
  color: #475569;
  cursor: pointer;
  border-right: 1px solid #cbd5e1;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.notice-mode-segment__btn:last-child {
  border-right: none;
}
.notice-mode-segment__btn:hover {
  background: #f8fafc;
  color: #1e293b;
}
.notice-mode-segment__btn.notice-mode-segment__btn--active {
  background: #2563eb;
  color: #fff;
}
.notice-mode-segment__btn.notice-mode-segment__btn--active:hover {
  background: #1d4ed8;
  color: #fff;
}
.notice-mode-panel {
  width: 100%;
  box-sizing: border-box;
}

/* 마을공지 — sims_schedule.html 일정 추가 모달과 동일한 날짜·시간 필드 스타일 */
#noticeInputModalBox .schedule-add-modal-field {
  margin-bottom: 16px;
}
#noticeInputModalBox .schedule-add-modal-field:last-child {
  margin-bottom: 0;
}
#noticeInputModalBox .schedule-add-modal-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 8px;
}
#noticeInputModalBox .schedule-add-modal-field select,
#noticeInputModalBox .schedule-add-modal-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}
#noticeInputModalBox .schedule-add-modal-field select:focus {
  outline: none;
  border-color: #2563eb;
}
#noticeInputModalBox .schedule-add-modal-time-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
#noticeInputModalBox .schedule-add-modal-time-row select {
  width: auto;
  min-width: 80px;
}
#noticeInputModalBox .date-select-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
#noticeInputModalBox .date-select-group select {
  width: auto !important;
  padding: 10px 6px !important;
}
#noticeInputModalBox .date-select-group .date-sel-year {
  min-width: 74px;
}
#noticeInputModalBox .date-select-group .date-sel-month,
#noticeInputModalBox .date-select-group .date-sel-day {
  min-width: 58px;
}
#noticeInputModalBox .date-select-group span {
  font-size: 14px;
  color: #475569;
}
.sms-settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
}
.sms-settings-char-count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
/* 설정 방법 선택 — 패딩 20px 24px */
.sims-modal-overlay .phone-setup-method-modal > .phone-setup-method-header {
  margin: -20px -28px 0 -28px;
  padding: 20px 28px 16px 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
}
.sims-modal-overlay .phone-setup-method-modal > .phone-setup-method-body {
  margin-top: 20px;
}
/* 전화번호부 목록 */
.sims-modal-overlay .phonebook-select-modal > .phonebook-select-header {
  margin: -20px -24px 0 -24px;
  padding: 20px 24px 16px 24px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
}
.sims-modal-overlay .phonebook-select-modal > .phonebook-select-table-wrap {
  margin-top: 20px;
}
/* 연락처 확인 */
.sims-modal-overlay .phonebook-confirm-modal > .phonebook-confirm-header {
  margin: -24px -28px 0 -28px;
  padding: 24px 28px 16px 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
}
.sims-modal-overlay .phonebook-confirm-modal > .phonebook-confirm-header + .modal-form-row {
  margin-top: 16px;
}
.sims-modal-overlay .phonebook-confirm-modal > .phonebook-confirm-footer {
  margin: 8px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}
/* 전화번호부 등록 */
.sims-modal-overlay .pb-register-modal > .pb-register-header {
  margin: -28px -28px 0 -28px;
  padding: 28px 28px 12px 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
  margin-bottom: 0;
}
.sims-modal-overlay .pb-register-modal > .pb-register-body {
  margin-top: 14px;
}
.sims-modal-overlay .pb-register-modal > .pb-register-footer {
  margin: 14px -28px -22px -28px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}

/* ── 테마 버튼 그리드 (3열 × 2행=6칸 / 전체 8개 시 3열 × 3행) ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e2e8f0;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.theme-btn {
  padding: 22px 8px;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border: none;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
}
.theme-btn i {
  font-size: 24px;
  color: #2563eb;
}
.theme-btn-text--media {
  display: block;
  line-height: 1.25;
  text-align: center;
}
.theme-btn:hover {
  background: #eff6ff;
}
.theme-btn.selected {
  background: #2563eb;
  color: #fff;
}
.theme-btn.selected i {
  color: #fff;
}

/* 영상 통화(카메라) 테마 버튼: 녹색 라운드 사각형 */
.theme-btn[data-theme="camera"] {
  background: #16a34a;
  color: #fff;
  border-radius: 10px;
}
.theme-btn[data-theme="camera"] i {
  color: #fff;
}
.theme-btn[data-theme="camera"]:hover {
  background: #15803d;
}
.theme-btn[data-theme="camera"].selected {
  background: #14532d;
  color: #fff;
}
.theme-btn[data-theme="camera"].selected i {
  color: #fff;
}

/* 관리자(user_type=2) 전용 3행: 기본 숨김 */
.theme-btn--admin-row { display: none !important; }
.theme-grid--admin-row-visible .theme-btn--admin-row { display: flex !important; }
.theme-btn--empty {
  cursor: default;
  pointer-events: none;
  background: #fff !important;
}

/* sims_users(JWT): 마을 공지·기타 제외, 6개 → 3열 × 2행 (동일 그리드) */
.theme-grid.theme-grid--sims-users {
  grid-template-columns: repeat(3, 1fr);
}

.theme-grid.theme-grid--sims-users .theme-btn {
  padding: 14px 6px;
  font-size: 12px;
}
@media (min-width: 480px) {
  .theme-grid.theme-grid--sims-users .theme-btn {
    font-size: 14px;
    padding: 18px 8px;
  }
}

/* ── 하위 설정: 단계 안내 (버튼 갯수 버튼 위) ── */
.sub-setting-step-hint {
  margin: 0 0 2px 0;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: #475569;
  width: 100%;
  max-width: var(--sims-setting-menu-max-width);
  box-sizing: border-box;
}

/* ── 테마 행: 테마 버튼 + 갯수 선택 버튼 + 갯수 라벨 가로 배치 ── */
.theme-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
}
.theme-row .theme-side-btn {
  flex-shrink: 0;
}
.theme-row__count-area {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  flex-shrink: 0;
}
.theme-row__count-val {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
  min-width: 28px;
  align-self: center;
}

/* ── 하위 설정 버튼 (메인 테마 대비 2단 들여쓰기: 24px + 24px) ── */
.sub-setting-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-left: 0;
}
.sub-setting-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border: 1.5px solid #93c5fd;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background 0.15s, border-color 0.15s;
  box-sizing: border-box;
}
.sub-setting-btn:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
}
.sub-setting-btn i {
  font-size: 14px;
  color: #64748b;
  width: 18px;
  text-align: center;
}

/* ── 숫자 선택 그리드 (3행 × 4열, 1~12) ── */
.num-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
#phoneCountModal .num-grid {
  grid-template-columns: repeat(3, 1fr);
}
.num-btn {
  padding: 20px 8px;
  font-size: 20px;
  font-weight: 700;
  color: #374151;
  background: #fff;
  border: none;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
}
.num-btn:nth-child(4n) { border-right: none; }
.num-btn:nth-child(n+9) { border-bottom: none; }
#phoneCountModal .num-btn:nth-child(4n) { border-right: 1px solid #e2e8f0; }
#phoneCountModal .num-btn:nth-child(3n) { border-right: none; }
#phoneCountModal .num-btn:nth-child(n+9) { border-bottom: 1px solid #e2e8f0; }
#phoneCountModal .num-btn:nth-child(n+7) { border-bottom: none; }
#phoneCountModal .num-grid.num-grid--sms {
  grid-template-columns: repeat(2, 1fr);
}
#phoneCountModal .num-grid.num-grid--sms .num-btn {
  border-bottom: none;
}
#phoneCountModal .num-grid.num-grid--sms .num-btn:nth-child(2) {
  border-right: none;
}
/* 화면 세로 크기 모달: 한 줄 4칸 */
.num-grid.num-grid-one-row .num-btn { border-bottom: none; }
.num-btn:hover { background: #eff6ff; }
.num-btn.selected {
  background: #2563eb;
  color: #fff;
}
/* 테마별 상한 초과 숫자(예: 문자 3~12, 날씨 7~12): 비활성 스타일 */
#phoneCountModal .num-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  color: #94a3b8;
  background: #f1f5f9;
}
#phoneCountModal .num-btn:disabled:hover {
  background: #f1f5f9;
}

/* ── 모달 하단 버튼 ── */
.sims-modal-footer {
  display: flex;
  justify-content: flex-end;
}
.btn-modal-close {
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  color: #475569;
  transition: background 0.15s;
}
.btn-modal-close:hover {
  background: #e2e8f0;
}

/* ── 위젯 배경 클릭 힌트 커서 ── */
.widget-box {
  cursor: pointer;
}

/* ── 색상 팔레트 오버레이 ── */
.color-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9100;
}
.color-palette-overlay.active {
  display: flex;
}
.color-palette {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  padding: 0;
  width: 260px;
  max-width: 90vw;
  box-sizing: border-box;
  font-size: 12px;
  overflow: hidden;
}
.color-palette-title {
  margin: 0 0 8px;
  padding: 14px 16px 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
}
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 16px 10px 16px;
}
.color-swatch,
.widget-bg-swatch {
  width: 100%;
  aspect-ratio: 4 / 1;   /* 세로 = 가로의 25% */
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  cursor: pointer;
  box-sizing: border-box;
}
.color-swatch.selected,
.widget-bg-swatch.selected {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.color-palette-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px 8px 16px;
}
.color-palette-custom label {
  font-size: 12px;
  color: var(--text-sub);
}
.color-palette-custom input[type="color"] {
  width: 44px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}
.color-palette-rgb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 16px 10px 16px;
  font-size: 11px;
}
.color-palette-rgb label {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-sub);
}
.color-palette-rgb input[type="number"] {
  width: 48px;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  box-sizing: border-box;
}
.color-palette-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 12px 16px 12px 16px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
}
.color-palette-btn {
  min-width: 60px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.color-palette-btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 600;
}
.color-palette-btn-primary:hover {
  background: #1d4ed8;
}

/* 전화 버튼 설정 방법 선택 모달 */
.phone-setup-method-modal {
  width: 100%;
  max-width: 280px;
  padding: 20px 28px 22px;
  box-sizing: border-box;
}
.phone-setup-method-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.phone-setup-method-header .sims-modal-title {
  margin: 0;
}
.btn-phone-setup-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s;
}
.btn-phone-setup-close:hover { color: #212529; }
.phone-setup-method-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-phone-setup-method {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #212529;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-phone-setup-method:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

/* 전화번호부 목록 모달 */
.phonebook-select-modal {
  width: 100%;
  max-width: 560px;
  padding: 20px 24px 24px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.phonebook-select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.phonebook-select-header .sims-modal-title { margin: 0; }
.btn-phonebook-select-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s;
}
.btn-phonebook-select-close:hover { color: #212529; }
.phonebook-select-table-wrap {
  overflow-y: auto;
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.phonebook-select-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.phonebook-select-table th,
.phonebook-select-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.phonebook-select-table th:last-child,
.phonebook-select-table td:last-child { text-align: center; }
.phonebook-select-table th {
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}
.phonebook-select-table td { color: #1e293b; }
.phonebook-select-table tbody tr:hover td {
  background: #eff6ff;
  cursor: pointer;
}
.phonebook-select-table tbody tr:nth-child(even) td { background-color: #f9fafb; }
.phonebook-select-table tbody tr:nth-child(even):hover td { background: #eff6ff; }
.phonebook-select-empty {
  padding: 32px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* 미디어 선택 모달 — 동영상 썸네일 플레이 뱃지 */
.media-select-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* 콘트롤 버튼 설정 모달 탭 — sims_setting.html 과 동일 패턴 */
/* 세로: min-height가 아니라 고정 height — 탭마다 내용 길이가 달라도 박스 크기 불변 */
#controlBtnConfigModal .sims-control-settings-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  height: min(690px, calc(100vh - 40px));
  overflow: hidden;
  box-sizing: border-box;
  gap: 0;
}
#controlBtnConfigModal .sims-control-modal-header-band {
  flex-shrink: 0;
  margin: -28px -28px 0 -28px;
  padding: 28px 28px 0 28px;
  background: var(--sims-modal-header-bg);
  border-bottom: 1px solid var(--sims-modal-edge-border);
  border-radius: 16px 16px 0 0;
}
#controlBtnConfigModal .sims-control-tab-form-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 18px 0 8px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
#controlBtnConfigModal .phone-cfg-footer {
  flex-shrink: 0;
  margin-top: auto;
  margin-left: -28px;
  margin-right: -28px;
  margin-bottom: -22px;
  padding: 14px 28px 22px 28px;
  background: var(--sims-modal-footer-bg);
  border-top: 1px solid var(--sims-modal-edge-border);
  border-radius: 0 0 16px 16px;
}
#controlBtnConfigModal .sims-control-settings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 12px;
  flex-shrink: 0;
}
#controlBtnConfigModal .sims-control-settings-top .sims-modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}
#controlBtnConfigModal .sims-control-open-bg-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
#controlBtnConfigModal .sims-control-open-bg-btn:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}
#controlBtnConfigModal .sims-control-setting-tabs-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding-bottom: 4px;
  border-bottom: none;
  flex-shrink: 0;
}
#controlBtnConfigModal .sims-control-setting-tabs-bar .setting-tabs {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  border-bottom: none;
}
#controlBtnConfigModal .setting-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
#controlBtnConfigModal .setting-tab-btn {
  position: relative;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  border-radius: 0;
  transition: color 0.15s ease-out;
}
#controlBtnConfigModal .setting-tab-btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background-color 0.15s ease-out;
}
#controlBtnConfigModal .setting-tab-btn.active {
  color: #1d4ed8;
}
#controlBtnConfigModal .setting-tab-btn.active::after {
  background: #1d4ed8;
}
#controlBtnConfigModal .sims-control-field-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  font-weight: 400;
}
#controlBtnConfigModal .sims-control-field-help strong {
  color: #1e293b;
  font-weight: 700;
}

.pb-register-modal {
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pb-register-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.pb-register-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pb-register-msg {
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
  word-break: keep-all;
}
.pb-register-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.btn-pb-reg-delete {
  padding: 6px 14px;
  border: 1px solid #ef4444;
  border-radius: 6px;
  background: #fff;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-pb-reg-delete:disabled { border-color: #cbd5e1; color: #94a3b8; cursor: not-allowed; }
.btn-pb-reg-delete:not(:disabled):hover { background: #fef2f2; }
.pb-register-table-wrap {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.pb-register-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  margin-top: 14px;
  flex-shrink: 0;
}
.pb-register-footer .btn-cancel {
  padding: 9px 22px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.pb-register-footer .btn-cancel:hover { background: #e2e8f0; }
.pb-register-footer .btn-apply {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.pb-register-footer .btn-apply:hover { background: #1d4ed8; }
.pb-register-footer .btn-apply:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* 연락처 확인 모달 */
.phonebook-confirm-modal {
  width: 100%;
  max-width: 400px;
  padding: 24px 28px 22px;
  gap: 0;
}
.phonebook-confirm-modal .modal-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.phonebook-confirm-modal .modal-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.phonebook-confirm-modal .modal-input {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
  outline: none;
  background: #f8fafc;
  color: #475569;
  pointer-events: none;
}
.phonebook-confirm-modal .modal-input--short { width: 80px; }
html[lang="en"] .phonebook-confirm-modal .modal-input--short {
  width: 11ch;
  min-width: 110px;
}
.phonebook-confirm-modal .modal-input:focus { border-color: #e2e8f0; box-shadow: none; }
.phonebook-confirm-modal .phone-cfg-color-btn { pointer-events: none; opacity: 0.65; cursor: default; }
.phonebook-confirm-modal .display-opt { pointer-events: none; cursor: default; }
.phonebook-confirm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.phonebook-confirm-header .sims-modal-title { margin: 0; font-size: 17px; font-weight: 700; color: #0f172a; }
.btn-phonebook-confirm-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s;
}
.btn-phonebook-confirm-close:hover { color: #212529; }
.phonebook-confirm-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.phonebook-confirm-photo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.phonebook-confirm-photo img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}
.phonebook-confirm-photo .no-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 28px;
}
.phonebook-confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.phonebook-confirm-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  width: 72px;
  flex-shrink: 0;
}
.phonebook-confirm-value {
  font-size: 14px;
  color: #0f172a;
  word-break: break-all;
}
.phonebook-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.phonebook-confirm-footer .btn-cancel {
  padding: 10px 22px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.phonebook-confirm-footer .btn-cancel:hover { background: #e2e8f0; }
.phonebook-confirm-footer .btn-apply {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.phonebook-confirm-footer .btn-apply:hover { background: #1d4ed8; }
.phonebook-confirm-footer .btn-apply:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* 날씨 예보 업데이트 간격 모달 안내 텍스트 */
.weather-interval-pick-info {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #713f12;
}

/* ── 날씨 로딩 모달 ── */
.weather-loading-overlay {
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
}
.weather-loading-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.22);
  padding: 32px 36px 28px;
  max-width: calc(100vw - 40px);
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.weather-loading-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.weather-loading-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5b82d8;
  animation: weatherDotBounce 1.2s ease-in-out infinite;
}
.weather-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.weather-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes weatherDotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1; }
}
.weather-loading-msg {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  line-height: 1.55;
  word-break: keep-all;
}

/* ── 마을 공지(이장) 지금 적용 → CSSP EasyPhone OTP 모달 ── */
/* 패딩은 상위 .sims-modal 기본(28px 28px 22px)을 그대로 씀.
   여기만 22/16으로 줄이면 .phone-cfg-footer의 margin -28/-22와 맞지 않아
   풋터 좌우·하단에 흰 띠가 생김(sims_screen 공통 phone-cfg-footer 규칙 전제: 모달 패딩 28·하단 22). */
.sims-otp-apply-modal {
  max-width: 420px;
  width: calc(100vw - 32px);
  box-sizing: border-box;
}
.sims-otp-apply-modal-body {
  text-align: center;
}
.sims-otp-apply-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  word-break: keep-all;
}
.sims-otp-apply-hint--top {
  margin-bottom: 14px;
  font-weight: 600;
}
.sims-otp-apply-hint--bottom {
  margin-top: 18px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #475569;
}
.sims-otp-digit-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.sims-otp-digit {
  width: 44px;
  height: 52px;
  padding: 0;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sims-otp-digit:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.sims-otp-apply-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 4px;
}
.sims-otp-apply-qr-wrap img {
  display: block;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
@media (max-width: 400px) {
  .sims-otp-digit {
    width: 40px;
    height: 48px;
    font-size: 20px;
  }
  .sims-otp-digit-row {
    gap: 6px;
  }
}

/* 마을공지 저장 전 안내 모달 */
.notice-save-confirm-modal {
  max-width: 480px;
  width: calc(100% - 32px);
}
.notice-save-confirm-body {
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.notice-save-confirm-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-line;
  word-break: keep-all;
}

/* ── 좌측 세로 테마 선택 버튼 목록 ── */
.theme-side-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 60%;
  max-width: calc(var(--sims-setting-menu-max-width) * 0.6);
  box-sizing: border-box;
  border-radius: 10px;
  padding: 2px;
  overflow: visible;
}
.theme-side-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border: 2px solid #94a3b8;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.theme-side-btn i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: inherit;
}
.theme-side-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
.theme-side-btn.selected {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.theme-side-btn.selected:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
/* 일정 버튼: 라운드 사각형 */
.theme-row[data-theme="schedule"] .theme-side-btn {
  border-radius: 8px;
}
/* 영상 통화 버튼: 비선택은 녹색 아웃라인, 선택만 솔리드(전화 파란 selected와 대비) */
.theme-row[data-theme="camera"] .theme-side-btn {
  border-radius: 10px;
  background: #fff;
  border-color: #16a34a;
  color: #15803d;
}
.theme-row[data-theme="camera"] .theme-side-btn:hover {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}
.theme-row[data-theme="camera"] .theme-side-btn.selected {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.theme-row[data-theme="camera"] .theme-side-btn.selected:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

/* GF set 상태 알림 텍스트 */
.theme-select-notice {
  margin: 0 0 6px 0;
  padding: 12px 16px;
  background: #1d4ed8;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  line-height: 1.65;
  word-break: keep-all;
  max-width: var(--sims-setting-menu-max-width);
  box-sizing: border-box;
  box-shadow: 0 6px 24px rgba(29,78,216,0.38);
}

/* 테마 선택 후 표시: 진동/소리/볼륨/밝기 안내 */
.theme-selected-control-notice {
  margin: 6px 0 0 0;
  padding: 12px 16px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  color: #1e40af;
  line-height: 1.65;
  word-break: keep-all;
  box-sizing: border-box;
  width: 100%;
}
.ctrl-btn-inline-img {
  display: inline-block;
  vertical-align: middle;
  height: 1.7em;
  width: auto;
  border-radius: 4px;
}
/* 안내문 인라인: 위젯 C영역과 동일 제어 아이콘 */
.ctrl-btn-inline-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  margin: 0 2px;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(30, 64, 175, 0.08);
}
.ctrl-btn-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 4px;
  background: #808080;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.ctrl-btn-inline-icon svg {
  width: 78%;
  height: 78%;
  display: block;
}

/* 전화~버스 그룹 래퍼 */
.theme-side-list-group {
  display: flex;
  flex-direction: column;
  gap: inherit;
  border-radius: 8px;
}
/* 일정 버튼: 그룹과 시각적 분리 + 세로 배치 */
.theme-row[data-theme="schedule"] {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  overflow: visible;
}
.theme-row[data-theme="schedule"] .theme-side-btn {
  align-self: stretch;
  width: 100%;
}
/* 일정 안내 텍스트: 버튼 너비의 2배(버튼 크기는 변경하지 않음) */
.theme-schedule-hint {
  margin: 4px 0 0;
  padding: 0 8px;
  font-size: 16.5px;
  color: #94a3b8;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
  box-sizing: border-box;
  flex-shrink: 0;
  min-width: calc(var(--sims-setting-menu-max-width) * 0.6 * 2);
  width: calc(var(--sims-setting-menu-max-width) * 0.6 * 2);
  max-width: none;
}
/* GF 상태 사각형 블링크 (전화~버스 그룹만) */
@keyframes themeSideListBlink {
  0%, 100% {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
  50% {
    outline: 2px solid #2563eb;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.28);
  }
}
.theme-side-list--blink {
  animation: themeSideListBlink 1.4s ease-in-out infinite;
}

/* 탭 바 기본 숨김 — 모바일에서만 표시 */
.screen-mobile-tab-bar { display: none; }

/* ════════════════════════════════════════
   모바일 전용 레이아웃 (파일 맨 끝 — 기본 스타일 이후 선언으로 cascade 확보)
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 헤더 숨김 + 바디 상단부터 시작 */
  .app-header.regi-header-layout { display: none !important; }
  .screen-body { top: 0 !important; flex-direction: column !important; }

  /* 커스텀 탭 버튼 바 */
  .screen-mobile-tab-bar {
    display: flex !important;
    flex-shrink: 0;
    width: 100%;
  }
  .screen-mobile-tab {
    flex: 1;
    height: 48px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-bottom: 3px solid #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .screen-mobile-tab--active {
    background: #2563eb !important;
    color: #fff !important;
    border-bottom-color: #1d4ed8;
    font-size: 18.75px;
  }
  .screen-mobile-tab:not(.screen-mobile-tab--active):active {
    background: #e2e8f0;
  }

  /* 스플리터 숨김 */
  .screen-splitter { display: none !important; }

  /* 패널 헤더 타이틀 숨김 (탭 버튼이 대체) */
  .screen-panel-header { display: none !important; }

  /* '가상 스마트폰 화면 주위의 … 설명이 표시됩니다.' 숨김 */
  .screen-panel-header-sub { display: none !important; }

  /* 패널: flex 레이아웃 유지 (display는 JS inline style로 제어) */
  .screen-left,
  .screen-right {
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    flex-direction: column !important;
  }

  /* 화면 선택 탭: 패널 전체 너비 확보 */
  .screen-left {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 화면 선택 영역: max-width 제한 해제 */
  .setting-menu-list,
  .theme-side-list {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 안내 박스: 연한 파란색 배경 (모바일 전용) */
  #themeSelectedControlNotice {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 테마 행: 세로 배치 — 갯수 변경 버튼이 테마 버튼 아래 표시 */
  .theme-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  .theme-row__count-area {
    width: 100%;
    padding-left: 80px;
    box-sizing: border-box;
  }
  .theme-row__count-btn {
    width: 100%;
    text-align: left;
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
  }

  /* 일정 안내: 모바일은 패널 전체 너비 사용(버튼과 동일, 2배 확장 불필요) */
  .theme-schedule-hint {
    min-width: 100%;
    width: 100%;
    max-width: 100%;
  }

  /* 블링크 오버레이 숨김 — 모바일에서는 갯수 버튼이 인라인 표시되므로 불필요 */
  #tslBlinkOverlay { display: none !important; }

  /* 스마트폰 프레임 내 마을공지·기상특보 수신 체크박스 숨김 */
  #phoneWidgetSubscribeRow { display: none !important; }

  /* 화면 구성: 원본 좌/우 버튼 컨테이너 숨김 (JS가 그리드로 이동) */
  .screen-right .phone-preview-left-stack,
  .screen-right .phone-side-actions { display: none !important; }

  /* 화면 구성: 폰 프레임 중앙 정렬 */
  .screen-right .widget-preview-preview-cluster { justify-content: center !important; }

  /* 화면 구성: 버튼 그리드 */
  .mobile-compose-btn-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 8px 80px;
    width: 100%;
    box-sizing: border-box;
  }
  .mobile-compose-btn-grid .btn-widget-action {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 12px !important;
    padding: 9px 4px !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    word-break: keep-all !important;
    line-height: 1.3 !important;
  }

  /* 화면 구성 탭 슬라이드 인/아웃 */
  @keyframes screenRightSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }
  @keyframes screenRightSlideOut {
    from { transform: translateX(0); }
    to   { transform: translateX(100%); }
  }
  .screen-right.screen-right--slide-in {
    animation: screenRightSlideIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .screen-right.screen-right--slide-out {
    animation: screenRightSlideOut 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
}

/* ── 사용법 문의 FAB: PC는 우측 하단, 모바일은 좌·우 분할 ── */
.screen-fab-bar {
  display: flex;
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 1200;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
.screen-fab-left {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.screen-fab-video {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}
.screen-fab-video:active { background: #1d4ed8; }
.screen-fab-inquiry {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 24px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.screen-fab-inquiry:active { background: #1d4ed8; }
.screen-fab-main { display: none; }
@media (max-width: 768px) {
  .screen-fab-bar {
    left: 16px;
    right: 16px;
    justify-content: space-between;
  }
  .screen-fab-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 24px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    pointer-events: auto;
  }
  .screen-fab-main:active { background: #1d4ed8; }
}

/* 공지 예시 버튼 */
.notice-example-btn {
  padding: 2px 10px;
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.6;
  transition: background 0.15s;
}
.notice-example-btn:hover {
  background: #e2e8f0;
}

/* 영상 통화 요청 화면 하단 FAB — 모달 위에 표시, 통화 진입 시 hidden */
#videoCallModal #vcFabBar {
  display: flex;
  position: fixed;
  right: 16px;
  bottom: 24px;
  left: auto;
  z-index: 9010;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
@media (max-width: 768px) {
  #videoCallModal #vcFabBar {
    left: 16px;
    right: 16px;
    justify-content: space-between;
  }
  #videoCallModal #vcFabBar .screen-fab-main { display: flex; }
}
@media (min-width: 769px) {
  #videoCallModal #vcFabBar .screen-fab-main { display: none !important; }
}
#videoCallModal #vcFabBar[hidden] {
  display: none !important;
}
#videoCallModal #vcFabBar .screen-fab-left {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
#videoCallModal #vcFabBar .screen-fab-video {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  font-size: 18px;
}
#videoCallModal #vcFabBar .screen-fab-inquiry,
#videoCallModal #vcFabBar .screen-fab-main {
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 24px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
#videoCallModal #vcFabBar .screen-fab-inquiry { display: flex; }

/* ── 영상 통화 모달: 폰 화면 크기 ───────────────────────────────────── */
#vcCallBody {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* 세로(portrait) 기본: 높이 기준, 9:16 비율 */
#vcPhoneScreen {
  height: min(calc(100vh - 200px), 600px);
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

/* 모바일 가로 모드: JS에서 클래스 토글로 제어 */
#videoCallModal.vc-landscape-mobile #vcCallBody { display: none !important; }
#videoCallModal.vc-landscape-mobile #vcLandscapeNotice { display: flex !important; }

/* ── 카메라 스트리밍 제어 버튼 (.btn-widget-action과 함께 사용) ── */
.btn-camera-ctrl {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
}
.btn-camera-ctrl:hover:not(:disabled) { background: #e2e8f0; }
.btn-camera-ctrl:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-camera-ctrl--stop {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-camera-ctrl--stop:hover:not(:disabled) { background: #fecaca; }
.btn-camera-ctrl--mic-on {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}
