/* Extracted legacy settings-base rules. Keep source order; existing screen overrides load later. */
@layer legacy {
.signature-editor canvas {
  width: 100%;
  max-width: min(100%, 60dvh);
  height: auto;
  aspect-ratio: 3 / 2;
  justify-self: center;
  display: block;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  touch-action: none;
  cursor: crosshair;
}
.signature-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
#profileSignatureOverlay { padding: 16px; }
.signature-editor.modal-card { width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow-y: auto; display: grid; gap: 14px; padding: 24px; border-radius: var(--r-lg); background: var(--panel); }
.signature-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signature-editor .hint { margin: 0; }
.signature-editor .signature-actions { align-items: center; }
#profileSignatureOverlay .signature-actions > button { height: 44px; min-height: 44px; font-size: var(--fs-body-l); }
body:has(#profileSignatureOverlay.visible) { overflow: hidden; }
#profileSignatureOverlay[aria-busy="true"] canvas { pointer-events: none; }
#profileSignatureStatus:empty { display: none; }
@media (max-width: 600px) {
  #profileSignatureOverlay { padding: 0; align-items: flex-end; }
  .signature-editor.modal-card { width: 100%; height: auto; max-height: 85dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 18px max(20px, env(safe-area-inset-bottom)); }
  .signature-editor::before { content: ""; width: 36px; height: 4px; border-radius: var(--r-full); background: var(--line-strong); justify-self: center; }
  .signature-editor canvas { max-width: min(100%, 60dvh); }
}
.profile-settings-section .full-btn { margin-top: 2px; }


.rate-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 74px; gap: 8px; }
.rate-editor input {
  min-width: 0;
  font-size: var(--fs-label);
  line-height: 1.2;
  font-weight: 600;
}
.rate-editor button {
  min-height: 44px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: var(--gold-ink);
  font-size: var(--fs-label);
  font-weight: 700;
}
.rate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.rate-list > .daily-card { grid-column: 1 / -1; }
.rate-chip {
  position: relative;
  border-radius: var(--r-md);
  background: var(--panel2);
  border: 1px solid var(--line);
  min-height: 54px;
  padding: 6px 4px 6px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-content: center;
  align-items: center;
  gap: 0;
  text-align: left;
  color: var(--text);
  cursor: default;
  min-width: 0;
  overflow: hidden;
}
.rate-chip-select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  grid-column: 1;
  grid-row: 1;
}
.rate-chip-select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.rate-chip strong {
  display: block;
  font-size: var(--fs-label);
  line-height: 1.2;
  letter-spacing: 0;
  font-family: var(--font-code);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rate-chip span {
  display: block;
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: var(--fs-caption);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rate-delete {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: var(--fs-body-l);
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: .78;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
}
@media (max-width: 430px) {
  .rate-list {
    gap: 6px;
  }
  .rate-editor input {
    font-size: var(--fs-label);
  }
  .rate-chip {
    border-radius: 11px;
    min-height: 54px;
    padding: 6px 4px 6px 8px;
  }
  .rate-delete {
    font-size: var(--fs-body);
  }
}
/* Monthly goal settings: one labelled amount field and save action. */
.goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.goal-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
}
.goal-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel2);
  color: var(--text);
  font-family: var(--font-numeric);
  font-size: var(--fs-body-l);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.goal-unit { color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.goal-save-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-full);
  background: var(--gold);
  color: var(--primary-dark);
  font-size: var(--fs-body-l);
  font-weight: 700;
  white-space: nowrap;
}
.settings-guide-row { text-decoration: none; }
.settings-guide-row em { font-style: normal; font-size: var(--fs-label); white-space: nowrap; }
.settings-guide-row strong { display: block; color: var(--text); font-size: var(--fs-body-l); }
.settings-guide-row small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }

/* === theme toggle === */
.theme-toggle { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.theme-toggle button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* The 30px segment keeps its look; the touch reaches 44px (2026-10-22). */
.theme-toggle button::after { content: ""; position: absolute; inset: -7px 0; }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.app-version {
  margin: 4px 0 18px;
  color: var(--soft);
  font-size: var(--fs-label);
  font-weight: 600;
  text-align: center;
}
/* 마이페이지 제목줄도 다른 탭처럼: 회색 띠·구분선 없이 22px 제목. */
.view-settings > .sub-header { padding-inline: 16px; padding-bottom: 12px; background: var(--bg); border-bottom: 0; }
.view-settings > .sub-header .sub-title strong { font-size: var(--fs-title-xl); font-weight: 700; letter-spacing: -.024em; line-height: 1.2; }
}
