/* 엄마약손 웹 — 앱(theme.dart) 색·모양을 그대로, 바탕만 흰색 */
:root {
  --brand: #F7A500; --brand-tint: #FFF3D6; --brand-text: #D98300;
  --primary: #FFD766; --on-primary: #3A2A05; --primary-soft: #FFF4D9; --primary-dark: #9A5B00;
  --accent: #0F8C7C; --accent-tint: #DDF4EF;
  --mint: #F3F4F6; --bg: #FFFFFF; --ink: #191F28; --sub: #6B7684; --line: #E8EBEE; --card-line: #EEF0F3;
  --open: #17A589; --gray-pin: #B4BAC2;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
main, .nav-in { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main { padding-bottom: 72px; }
h1, h2, h3 { text-wrap: balance; }

/* 머티리얼 아이콘 */
.ms {
  font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  display: inline-block; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; -webkit-font-smoothing: antialiased; vertical-align: middle;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* 머리말 + 탭 */
:root { --navtop: calc(env(safe-area-inset-top, 0px) + 12px); --navh: calc(60px + var(--navtop)); }
/* 노치·상태 표시줄 밑으로 들어가지 않게 안전 영역만큼 내려서 그린다(홈 화면 앱·전체 화면 브라우저) */
.nav { position: sticky; top: 0; z-index: 1000; padding-top: var(--navtop); background: #fff; border-bottom: 1px solid var(--card-line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.logo-mark { width: 42px; height: 42px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(27,39,51,.12); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; padding: 3px; }
.logo-mark i { font-style: normal; font-weight: 800; font-size: 14px; line-height: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; border-radius: 4.5px; background: var(--mint); color: var(--ink); }
.logo-mark i.y { background: #D98000; color: #fff; }
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -0.5px; }
.wordmark b { color: var(--brand-text); font-size: 1.08em; font-weight: 800; }
.tabs { display: flex; gap: 2px; }
.tabs a { display: flex; align-items: center; gap: 4px; text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--sub); padding: 7px 11px; border-radius: 999px; white-space: nowrap; }
.tabs a .ms { font-size: 19px; }
.tabs a[aria-current="page"] { background: var(--accent-tint); color: var(--ink); font-weight: 800; }
.tabs a[aria-current="page"] .ms { color: var(--accent); font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
@media (max-width: 480px) {
  .wordmark { display: none; }
  .tabs a { padding: 7px 9px; font-size: 13px; }
  .tabs a .ms { display: none; }
}

/* 공통 모양 */
.softcard { background: #fff; border: 1px solid var(--card-line); border-radius: 20px; box-shadow: 0 2px 12px rgba(27,39,51,.04); }
.fbtn, .obtn, .tbtn { appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; border-radius: 16px; }
.fbtn { border: 0; background: var(--primary); color: var(--on-primary); min-height: 54px; padding: 0 20px; font-size: 16px; font-weight: 700; }
.obtn { border: 1px solid var(--line); background: #fff; color: var(--ink); min-height: 50px; padding: 0 18px; font-size: 15px; font-weight: 600; }
.tbtn { border: 0; background: none; color: var(--primary-dark); font-weight: 700; padding: 6px 4px; }
.fbtn:disabled, .obtn:disabled { opacity: .45; cursor: default; }
.fbtn.sm, .obtn.sm { min-height: 38px; font-size: 14px; border-radius: 12px; padding: 0 12px; }
.fbtn .ms, .obtn .ms { font-size: 18px; }
.fine { font-size: 12px; color: var(--sub); line-height: 1.55; margin: 12px 2px; }
.w100 { width: 100%; }

/* 출처 */
.sources { display: flex; gap: 10px; background: var(--mint); border-radius: 18px; padding: 16px; margin: 16px 0; font-size: 11px; line-height: 1.5; color: #4E5968; }
.sources > .ms { color: var(--sub); font-size: 20px; flex: none; }
.sources b { display: block; font-weight: 700; margin-bottom: 2px; }
.sources p { margin: 0 0 4px; }
.sources p:last-child { margin: 4px 0 0; }

/* 아래에서 올라오는 시트 */
.sheet-bg { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.32); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.sheet { width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: #D5D9DE; margin: 0 auto 14px; }
.sheet h3 { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

/* 알림 */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4000; background: #323A45; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: fade .2s; }

/* 확인 창 */
.dlg h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.dlg p { color: var(--sub); margin: 0 0 18px; }
.dlg .row { display: flex; gap: 8px; }
.dlg .row > * { flex: 1; }

/* 폼 */
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* 스위치 */
.switch { position: relative; display: inline-flex; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #E5E8EB; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); background: #3A2A05; }

/* 맨 아래 띠 배너: 화면에 붙어 있고, 다른 아래쪽 버튼은 그만큼 위로 */
.ad-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(54px + env(safe-area-inset-bottom)); padding: 2px 0 env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--card-line); display: flex; justify-content: center; align-items: flex-start; }
html.has-ad body { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
html.has-ad .md-bottom { bottom: calc(54px + env(safe-area-inset-bottom)) !important; }
html.has-ad .md-fab { margin-bottom: 54px; }
.ad-preview { width: 320px; height: 50px; border-radius: 6px; background: #F3F4F6; border: 1px dashed #C9CED6; color: #8B95A1; font-size: 12px; display: grid; place-items: center; }
