/* ============================================================
   설정 (/settings/)
   셸·상단바·버튼은 doctor.css 를 그대로 쓰고, 여기에는 설정 화면 고유의
   것 — 카드, 스위치, 구간 선택, 숫자 입력 — 만 둔다.
   ============================================================ */

.st-main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 14px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- 카드 ---------- */
.st-card {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 18px;
    margin-bottom: 14px;
}
.st-head { margin-bottom: 16px; }
.st-head h2 {
    display: flex; align-items: center; gap: 9px;
    font-size: 1rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink);
    margin-bottom: 7px;
}
.st-head h2 i { color: var(--brand); font-size: 0.95em; }
.st-head p {
    font-size: 0.8rem; color: var(--ink-3); line-height: 1.65;
    word-break: keep-all; overflow-wrap: break-word;
}
.st-head p b { color: var(--ink-2); font-weight: 700; }

.st-sub {
    font-size: 0.84rem; font-weight: 800; color: var(--ink);
    margin: 20px 0 8px;
}
.st-hint {
    display: block; font-size: 0.74rem; color: var(--ink-3);
    line-height: 1.6; margin-top: 6px; word-break: keep-all;
}
.st-warn {
    display: flex; align-items: center; gap: 9px;
    background: var(--warn-soft); border: 1px solid #ffe2a8; border-radius: var(--r-sm);
    padding: 12px 14px; font-size: 0.82rem; color: #92400e;
}
.st-warn code { background: rgba(0,0,0,.06); border-radius: 5px; padding: 1px 5px; }
.st-need { color: var(--warn, #b8781f); font-weight: 700; }
.st-loading { font-size: 0.82rem; color: var(--ink-3); padding: 12px 0; text-align: center; }

/* 꺼진 영역 — 지우지 않고 흐리게 둔다. 무엇이 있는지는 보여야 한다. */
.dim { opacity: 0.4; pointer-events: none; }

/* ---------- 줄 ---------- */
.st-row { margin-bottom: 16px; }
.st-row > label {
    display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px;
}
.st-row select {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    font-family: inherit; font-size: 0.9rem; color: var(--ink);
    background: #f7fafc; outline: none;
}
.st-row select:focus { border-color: var(--brand); background: #fff; }

/* ---------- 구간 선택 (주기) ---------- */
.st-seg {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 4px; background: #f2f6fa; border-radius: 12px; padding: 4px;
}
.st-seg-btn {
    border: none; background: none; border-radius: 9px;
    padding: 10px 2px;
    font-family: inherit; font-size: 0.76rem; font-weight: 700; color: var(--ink-3);
    letter-spacing: -0.04em;
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.st-seg-btn.on { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-1); }

/* ---------- 태그 (관심 분야) ---------- */
.st-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.st-chip {
    border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 8px 14px;
    font-family: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink-3);
    cursor: pointer;
}
.st-chip.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-deep); }

/* ---------- 스위치 ---------- */
.st-toggle {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-top: 1px solid var(--line-soft);
}
.st-toggle:first-of-type { border-top: none; }
.st-toggle > div { flex: 1; min-width: 0; }
.st-toggle strong {
    display: block; font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 3px;
}
.st-toggle span {
    display: block; font-size: 0.76rem; color: var(--ink-3); line-height: 1.55;
    word-break: keep-all; overflow-wrap: break-word;
}
.st-sw {
    flex: 0 0 auto; position: relative;
    width: 50px; height: 30px; border-radius: 999px;
    border: none; background: #d5dee7; cursor: pointer; padding: 0;
    transition: background 0.18s;
}
.st-sw i {
    position: absolute; top: 3px; left: 3px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform 0.18s;
}
.st-sw.on { background: var(--brand); }
.st-sw.on i { transform: translateX(20px); }

.st-push-state { font-size: 0.76rem; color: var(--ink-3); line-height: 1.6; margin-top: 2px; word-break: keep-all; }
.st-push-state.ok   { color: var(--brand-deep); font-weight: 700; }
.st-push-state.warn { color: var(--warn, #b8781f); font-weight: 700; }
.st-meta { font-size: 0.74rem; color: var(--ink-3); margin-top: 12px; }

/* ---------- 숫자 입력 (기준값) ---------- */
.st-nums {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 12px; margin-top: 14px;
}
.st-num label {
    display: block; font-size: 0.76rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px;
}
.st-num > div { display: flex; align-items: center; gap: 8px; }
.st-num input {
    flex: 1; min-width: 0; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    font-family: inherit; font-size: 0.9rem; color: var(--ink);
    background: #f7fafc; outline: none;
}
.st-num input:focus { border-color: var(--brand); background: #fff; }
.st-num > div > span { font-size: 0.76rem; color: var(--ink-3); flex: 0 0 auto; }

/* ---------- 내 정보 ---------- */
.st-fill { margin-bottom: 16px; }
.st-fill-top {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 0.78rem; color: var(--ink-2); margin-bottom: 7px;
}
.st-fill-top b { font-size: 1rem; font-weight: 800; color: var(--brand-deep); }
.st-fill-bar { height: 7px; border-radius: 999px; background: #eef3f8; overflow: hidden; }
.st-fill-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }

.st-profile { display: flex; flex-direction: column; gap: 12px; }
.st-prow label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.76rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px;
}
.st-src {
    font-size: 0.64rem; font-weight: 800; font-style: normal;
    border-radius: 999px; padding: 2px 7px;
    background: #eef3f8; color: var(--ink-3);
}
.st-src.user   { background: var(--brand-soft); color: var(--brand-deep); }
.st-src.ai     { background: var(--warn-soft); color: #b8781f; }
.st-src.doctor { background: #e9f0ff; color: #2a5bd7; }
.st-prow input {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    font-family: inherit; font-size: 0.9rem; color: var(--ink);
    background: #f7fafc; outline: none;
}
.st-prow input:focus { border-color: var(--brand); background: #fff; }
.st-prow input::placeholder { color: #b3c1cf; }

.st-facts { margin-top: 4px; }
.st-fact {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-top: 1px solid var(--line-soft);
    font-size: 0.8rem; color: var(--ink-2); line-height: 1.5;
}
.st-fact > div { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: break-word; }
.st-fact b { color: var(--ink); font-weight: 800; }
.st-fstat {
    display: inline-block; margin-left: 4px;
    font-size: 0.66rem; font-weight: 800; border-radius: 999px; padding: 2px 7px;
    background: var(--warn-soft); color: #b8781f;
}
.st-fstat.confirmed { background: var(--brand-soft); color: var(--brand-deep); }
.st-fno {
    flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 6px 12px;
    font-family: inherit; font-size: 0.73rem; font-weight: 700; color: var(--ink-3); cursor: pointer;
}
.st-fno:disabled { opacity: 0.5; }

/* ---------- 계정 ---------- */
.st-kv {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 11px 0; border-top: 1px solid var(--line-soft);
    font-size: 0.84rem; color: var(--ink-3);
}
.st-kv:first-of-type { border-top: none; }
.st-kv b { color: var(--ink); font-weight: 700; }

.st-devices { display: flex; flex-direction: column; gap: 8px; }
.st-dev {
    display: flex; align-items: center; gap: 11px;
    background: #f7fafc; border-radius: var(--r-sm); padding: 11px 13px;
}
.st-dev i { color: var(--brand); font-size: 15px; flex: 0 0 auto; }
.st-dev > div { flex: 1; min-width: 0; line-height: 1.35; }
.st-dev b { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.st-dev span {
    display: block; font-size: 0.7rem; color: var(--ink-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-dev em { font-size: 0.7rem; color: var(--ink-3); font-style: normal; flex: 0 0 auto; }

.st-acts { display: flex; gap: 8px; margin-top: 14px; }
.st-foot { text-align: center; font-size: 0.74rem; color: var(--ink-3); padding: 8px 0 20px; }

/* ---------- 저장 알림 ---------- */
.st-toast {
    position: fixed; left: 50%; bottom: 84px; z-index: 1500;
    transform: translate(-50%, 12px);
    display: flex; align-items: center; gap: 8px;
    background: rgba(15, 23, 42, 0.92); color: #fff;
    border-radius: 999px; padding: 11px 20px;
    font-size: 0.82rem; font-weight: 700;
    opacity: 0; transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.st-toast.show { opacity: 1; transform: translate(-50%, 0); }
.st-toast[hidden] { display: none; }
.st-toast i { color: #4ade80; }

@media (min-width: 992px) {
    .st-toast { bottom: 32px; }
}
