/* ── sims 위젯 내부 스타일 ── */

/*
 * #widgetBox.widget-box — 화면(sims_screen)은 인라인 스타일에서 overflow:hidden을 주지만,
 * 미리보기(sims_preview)는 위 규칙이 없어 JS로만 border-radius를 줄 때 자식(.widget-root·P/C)이
 * 부모의 둥근 모서리 밖까지 직사각형으로 칠해져 아래쪽 라운드가 사라진 것처럼 보인다.
 */
.widget-box {
  overflow: hidden;
  box-sizing: border-box;
}

/* P/C 영역 (docs/widget-layout-emulator.md) */
.widget-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.widget-p-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.widget-p-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  /* P=1: stack-v / stacked 와 동일하게 P영역 안쪽 여백 */
  padding: 3%;
  box-sizing: border-box;
}
.widget-p-fill > .widget-phone-btn {
  flex: 1;
  min-height: 0;
}
.widget-p-stack-v {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3%;
  padding: 3%;
  box-sizing: border-box;
}
.widget-p-stack-v > .widget-phone-btn {
  flex: 1;
  min-height: 0;
}
.widget-p-row {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 3%;
}
.widget-p-row.widget-p-row--grid {
  display: grid;
  flex-direction: unset;
  gap: 3%;
  min-height: 0;
  align-items: stretch;
}
/* P=2·3 가로 한 줄(tallNarrow): row만 쓰면 stack-v·stacked와 달리 패딩이 없어 박스에 붙음 */
.widget-p-row.widget-p-row--h2,
.widget-p-row.widget-p-row--h3 {
  padding: 3%;
  box-sizing: border-box;
}
.widget-p-row--h2 > .widget-phone-btn,
.widget-p-row--h3 > .widget-phone-btn {
  flex: 1;
  min-width: 0;
}
.widget-p-row--single {
  justify-content: stretch;
}
.widget-p-row--single > .widget-phone-btn {
  flex: 1;
  width: 100%;
}
.widget-p-stacked {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3%;
  padding: 3%;
  box-sizing: border-box;
}
.widget-p-stacked > .widget-p-row {
  flex: 1 1 0%;
  min-height: 0;
}
.widget-p-row.widget-p-row--grid > .widget-phone-btn {
  min-width: 0;
  min-height: 0;
}

.widget-c-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  box-sizing: border-box;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  padding: 0;
  gap: 0;
}
.widget-c-info-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9em;
  line-height: 1;
}
.widget-c-info-btn:hover {
  color: #fff;
}
.widget-c-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
  user-select: none;
}
/* 진동·소리·볼륨·밝기: 아이콘 버튼 (버튼 간 여백은 JS에서 C높이/8 gap으로 설정) */
.widget-c-btn--control {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: default;
  border: 1px solid rgba(0, 0, 0, 0.12);
  /* 기본 배경/아이콘색은 sims_widget.js buildCArea에서 #808080 / #ffffff 로 설정 */
  background: #808080;
  color: #ffffff;
}
.widget-c-btn--control .widget-c-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.45em;
  height: 1.45em;
  max-width: 86%;
  max-height: 78%;
  pointer-events: none;
}
.widget-c-btn--control .widget-c-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.widget-c-btn--theme {
  cursor: pointer;
  background: #4b5563;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  border-radius: 8px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.widget-c-btn--theme:hover {
  background: #3d4553;
}
.widget-c-theme-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  line-height: 1.15;
}
.widget-c-theme-sub {
  font-weight: 500;
  font-size: 0.88em;
  color: rgba(255, 255, 255, 0.92);
}
.widget-c-theme-name {
  font-weight: 600;
  font-size: 1em;
  color: #fde047;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 전화 위젯 그리드 */
.widget-phone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 기본: 4열 */
  grid-auto-rows: 1fr;
  gap: 3%;
  padding: 3%;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* 3열 그리드 (N=5~8, P=4~7) */
.widget-phone-grid[data-cols="3"] {
  grid-template-columns: repeat(3, 1fr);
}

/* 2열 그리드 (N=2~4, P=1~3) */
.widget-phone-grid[data-cols="2"] {
  grid-template-columns: repeat(2, 1fr);
}

/* 1열 그리드 (P=1) */
.widget-phone-grid[data-cols="1"] {
  grid-template-columns: repeat(1, 1fr);
}

.widget-phone-btn {
  background: #DDDDDD;
  /* border-radius는 JS에서 P=12(4×3 그리드) 최소 셀의 min(side)*16%로 고정(sims_widget.js) */
  min-height: 0;
  min-width: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, transform 0.1s;
  /* 자식(img·레이아웃 div)이 호버를 가로채면 부모 title 툴팁이 안 뜨는 경우가 있어, 히트는 버튼에만 */
  pointer-events: auto;
}
.widget-phone-btn * {
  pointer-events: none;
}

/* ── 버튼 콘텐츠 공통 ── */
.wbtn-label {            /* 텍스트 단독 (정사각형·와이드 공통) */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  line-height: 1;
  pointer-events: none;
}
/* §12.1 P≥3·TALL·텍스트만: 코드포인트 세로열 */
.wbtn-label.wbtn-label--vertical {
  line-height: 1.15;
  text-align: center;
  white-space: pre-line;
  justify-content: center;
}

/* 문자 테마: 텍스트 단독 시 상단 정렬 · 줄간격 = 글자 크기의 125%(추가 간격 ≈ 25%) */
.wbtn-label.wbtn-label--sms-top {
  align-items: flex-start;
  justify-content: center;
  padding: 3px 4px 0;
  box-sizing: border-box;
  line-height: 1.25;
}
.wbtn-label.wbtn-label--vertical.wbtn-label--sms-top {
  justify-content: flex-start;
  line-height: 1.25;
}

/* §12.3·§10 픽셀 지름 원형 사진 + 텍스트 (에뮬레이터 규칙) */
.wbtn-photo.wbtn-photo--circle {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

/* 가로형 규칙: 버튼 너비 50% / 50% — 좌 사진, 우 텍스트 */
.wbtn-wide-inner.wbtn-wide-inner--rules {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
}
.wbtn-wide-half {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.wbtn-wide-inner--rules .wbtn-text--rules-side {
  max-width: 100%;
  display: block;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  overflow: hidden;
  text-align: center;
  line-height: 1.15;
}

/* 기본 .wbtn-wide-inner .wbtn-photo 의 %마진·%높이 무력화 */
.wbtn-wide-inner.wbtn-wide-inner--rules .wbtn-photo.wbtn-photo--circle {
  margin: 0;
  height: auto;
  max-height: none;
  aspect-ratio: unset;
}

.wbtn-phone-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
  /* padding-top / padding-bottom: JS */
}
/* 정사각·tier≥2: 세로 나열, 상단 10%는 JS. auto 마진 제거해 사진·텍스트가 버튼 안에 유지 */
.wbtn-phone-stack.wbtn-phone-stack--square-tier2 {
  justify-content: flex-start;
}
.wbtn-phone-stack--square-tier2 .wbtn-text--rules-below {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wbtn-text--rules-below {
  flex-shrink: 0;
  margin-top: auto;
  text-align: center;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
}
.wbtn-phone-stack--square-tier2 .wbtn-photo.wbtn-photo--circle {
  flex-shrink: 0;
}

/* §12.2 정사각 1단계·사진 우선: 원만 */
.wbtn-tier1-square-photo-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wbtn-photo-square {     /* P=6~11 photo 모드: 버튼 전체 꽉 채움 */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.wbtn-media-thumb {      /* 사진 테마: 버튼/이미지 비율 비교 후 비율 유지 contain */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.wbtn-media-play {       /* 동영상 썸네일 위 재생 삼각형 오버레이 */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* 문자 테마 세로열: 3×3 — 행 1~2=텍스트, (3,3)=썸네일(contain) */
.wbtn-sms-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  box-sizing: border-box;
}
.wbtn-sms-text-zone {
  grid-column: 1 / 4;
  grid-row: 1 / 3;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2px 4px 0;
  box-sizing: border-box;
  overflow: hidden;
}
.wbtn-sms-text {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.25;
  text-align: center;
}
.wbtn-sms-text--vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.05em;
}
.wbtn-sms-thumb-wrap {
  grid-column: 3;
  grid-row: 3;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* 문자 테마 가로: (3,3) contain 크기 → 우·하 10px 배치 → 상단·중간(이미지 윗줄까지)·하단(이미지 왼쪽 띠) */
.wbtn-sms-zone-horiz {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
}
.wbtn-sms-upper-flow {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.wbtn-sms-slot-top-txt {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.25;
  word-break: break-word;
}
.wbtn-sms-slot-mid-txt {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.25;
  word-break: break-word;
}
.wbtn-sms-slot-lower-wide {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.25;
  word-break: break-word;
}
.wbtn-sms-slot-lower-narrow {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  text-align: left;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1.25;
  word-break: break-word;
}
.wbtn-sms-slot-abs-thumb {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

/* ── P=3 세로텍스트형 (좌=사진, 우=세로글자) ── */
.wbtn-wide-v-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}
.wbtn-wide-v-inner .wbtn-photo {
  height: 76%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 50%;
  margin: auto 5% auto 7%;
  align-self: center;
}
.wbtn-wide-v-inner .wbtn-text-v {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.75em;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  overflow: hidden;
  letter-spacing: 0.05em;
}

.wbtn-photo-fill {       /* 정사각형: 원 프레임 안에 사진 */
  position: absolute;
  width: 72%;
  aspect-ratio: 1 / 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

/* ── 가로형(WIDE) 버튼: 좌=사진, 우=글자 ── */
.wbtn-wide-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}
.wbtn-wide-inner .wbtn-photo {
  height: 76%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 50%;
  margin: auto 5% auto 7%;
  align-self: center;
}
.wbtn-wide-inner .wbtn-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  overflow: hidden;
  padding: 0 4%;
}

/* ── 세로형(PORTRAIT) 버튼: 위=사진, 아래=글자 ── */
.wbtn-portrait-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8%;
  box-sizing: border-box;
}
.wbtn-portrait-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}
.wbtn-portrait-inner .wbtn-photo {
  width: 74.75%; /* 65% * 1.15 (+15%) */
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: -9.75%; /* 증가분(9.75%W)만큼 상쇄 → 텍스트 위치 유지 */
}
.wbtn-portrait-inner .wbtn-text {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 400;
  color: inherit;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  overflow: hidden;
  padding: 2% 0;
}

/* 기존 설정 버튼 자리 (숨김 — 레이아웃 공간 유지용) */
.widget-phone-btn--settings {
  visibility: hidden;
  pointer-events: none;
}

/* 원형 설정 버튼 (우측 하단 고정) */
.widget-settings-circle {
  position: absolute;
  right: 3%;
  bottom: 3%;
  border-radius: 999px;
  background: #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  cursor: pointer;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 6px;
  box-sizing: border-box;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
}
.widget-settings-circle:hover {
  background: #606060;
}

/* ── 전화 버튼 설정 모달 ── */
.phone-cfg-modal {
  width: 360px;
}
.phone-cfg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.phone-cfg-header .sims-modal-title {
  margin: 0;
}
.phone-cfg-header.phone-cfg-header--title-only {
  justify-content: center;
}
.phone-cfg-header.phone-cfg-header--title-only .sims-modal-title {
  width: 100%;
  text-align: center;
}

.weather-forecast-select-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.weather-forecast-summary {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

#weatherForecastPickModal.sims-modal-overlay {
  z-index: 9105;
}
#weatherRegionPickModal.sims-modal-overlay {
  z-index: 9106;
}
.weather-forecast-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(58vh, 400px);
  overflow-y: auto;
  padding: 4px 0 2px;
  margin: 0;
}
.weather-forecast-option-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.12s, border-color 0.12s;
}
.weather-forecast-option-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.weather-forecast-option-btn--selected {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}
.weather-forecast-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}
.weather-forecast-option-btn:disabled:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.weather-forecast-option-btn--selected:disabled {
  opacity: 0.55;
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
}

.weather-region-pick-list .weather-region-option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  text-align: left;
}
.weather-region-option-title {
  font-weight: 600;
  color: inherit;
  line-height: 1.3;
}
.weather-region-option-sub {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
  word-break: break-word;
}
.weather-region-option-btn--selected .weather-region-option-sub {
  color: #475569;
}

.widget-phone-btn .wbtn-weather-forecast-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  font-size: clamp(11px, 2.8vw, 15px);
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
  box-sizing: border-box;
}
.phone-cfg-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}
.btn-phone-cfg-reset {
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  border: 1px solid #e74c3c;
  border-radius: 8px;
  background: #fff;
  color: #e74c3c;
  cursor: pointer;
  white-space: nowrap;
}
.btn-phone-cfg-reset:hover {
  background: #e74c3c;
  color: #fff;
}
.phone-cfg-modal .modal-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.phone-cfg-modal .modal-form-row + .modal-form-row {
  margin-top: 14px;
}
.phone-cfg-modal .modal-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.phone-cfg-modal .modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.phone-cfg-modal .modal-input:focus {
  border-color: #2563eb;
}
.phone-cfg-modal .modal-input--short {
  width: 80px;
}
html[lang="en"] .phone-cfg-modal .modal-input--short {
  width: 11ch;
  min-width: 110px;
}

/* 전화 버튼 항상 표시 체크박스 행 */
.phone-cfg-always-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.phone-cfg-always-display-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

/* 글자/사진 선택 — area-unit-group 스타일 복제 */
.phone-cfg-display-group {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.phone-cfg-display-group .display-opt {
  flex: 1;
  margin: 0;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  border-right: 1px solid #cbd5e1;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.phone-cfg-display-group .display-opt:last-child {
  border-right: none;
}
.phone-cfg-display-group .display-opt input {
  display: none;
}
.phone-cfg-display-group .display-opt:has(input:checked) {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  border-color: transparent;
}

/* 사진 선택 버튼 + 미리보기 행 */
.phone-cfg-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 미리보기 래퍼 (상대위치 → X 버튼 절대위치 기준) */
.phone-cfg-preview-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

/* 크롭·리사이즈된 사진 미리보기 */
.phone-cfg-photo-preview {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  display: block;
}

/* 사진 삭제 X 버튼 */
.phone-cfg-preview-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* 버튼 색상 선택 버튼 */
.phone-cfg-color-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.12s;
}
.phone-cfg-color-btn:hover {
  background: #e2e8f0;
}
.phone-cfg-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  display: inline-block;
}

/* 사진 선택 버튼 */
.phone-cfg-photo-btn {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.12s;
}
.phone-cfg-photo-btn:hover {
  background: #e2e8f0;
}

.media-select-video-source {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.media-select-video-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.media-select-video-opt input[type="radio"] {
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.media-select-video-link-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #334155;
  word-break: break-all;
}

/* 모달 하단 버튼 행 */
.phone-cfg-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.phone-cfg-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;
}
.phone-cfg-footer .btn-apply {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

/* ── P별 폰트 크기 조정 ── */

/* P=6~11: +15% */
.widget-phone-grid[data-p="6"]  .wbtn-label,
.widget-phone-grid[data-p="7"]  .wbtn-label,
.widget-phone-grid[data-p="8"]  .wbtn-label,
.widget-phone-grid[data-p="9"]  .wbtn-label,
.widget-phone-grid[data-p="10"] .wbtn-label,
.widget-phone-grid[data-p="11"] .wbtn-label {
  font-size: 0.74em;
}

/* P=5: +25% */
.widget-phone-grid[data-p="5"] .wbtn-label {
  font-size: 1.25em;
}

/* P=4: +25% */
.widget-phone-grid[data-p="4"] .wbtn-label {
  font-size: 1.375em;
}

/* P=3: +25% → 추가 +20% */
.widget-phone-grid[data-p="3"] .wbtn-label {
  font-size: 2.25em;
}
.widget-phone-grid[data-p="3"] .wbtn-wide-v-inner .wbtn-text-v {
  font-size: 0.9em;
}

/* P=2: 사진 없을 때 폰트 유지, 사진 있을 때 텍스트 폰트 2배 + 사진↔텍스트 여백 */
.widget-phone-grid[data-p="2"] .wbtn-label {
  font-size: 2.76em;
}
.widget-phone-grid[data-p="2"] .wbtn-portrait-inner .wbtn-text {
  font-size: 2.07em;
}
.widget-phone-grid[data-p="2"] .wbtn-portrait-inner .wbtn-photo {
  margin-bottom: 0;
}
.widget-phone-grid[data-p="2"] .wbtn-portrait-group {
  gap: 0.5175em;
}

/* P=1: 사진 없을 때 폰트 2배, 사진 있을 때 텍스트 폰트 15% 감소 */
.widget-phone-grid[data-p="1"] .wbtn-label {
  font-size: 4.68em;
}
.widget-phone-grid[data-p="1"] .wbtn-wide-inner .wbtn-text {
  font-size: 1.751em;
}
.widget-phone-grid[data-p="1"] .wbtn-wide-inner .wbtn-photo {
  height: 83.6%;
}

/* 날씨 여백 색상 선택 스와치 */
.weather-bg-color-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.weather-bg-swatch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: border-color 0.15s;
}
.weather-bg-swatch.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}
.weather-bg-swatch-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
