/* ===== 手機フレーム + アプリ内UI ===== */
.phone { --pw: 356px; --ph: 728px; width: var(--pw); height: var(--ph); border-radius: 50px; background: #111722; padding: 11px; position: relative; box-shadow: 0 30px 60px rgba(8, 14, 28, .45), inset 0 0 0 2px #2b3446, 0 0 0 1px rgba(255, 255, 255, .08); flex: none; font-family: var(--sans); color: var(--text); line-height: 1.5; }
.phone.and { border-radius: 38px; }
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 40px; overflow: hidden; background: #faf7f0; display: flex; flex-direction: column; }
.phone.and .screen { border-radius: 28px; }
.phone * { box-sizing: border-box; }
.phone button { font-family: inherit; }

/* ステータスバー */
.sb { height: 46px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 6px; font-size: 13px; font-weight: 700; color: #16233b; position: relative; z-index: 6; background: #faf7f0; }
.sb .r { display: flex; gap: 5px; align-items: center; font-size: 14px; }
.sb .r .ic { width: 15px; height: 15px; }
.phone.ios .sb::before { content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 27px; background: #0a0d14; border-radius: 20px; }
.phone.and .sb { padding-left: 22px; padding-right: 22px; }
.phone.and .sb::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; background: #0a0d14; border-radius: 50%; }

/* ホームバー / ナビバー */
.hbar { height: 22px; flex: none; display: grid; place-items: center; background: #faf7f0; position: relative; z-index: 6; }
.hbar i { width: 118px; height: 5px; border-radius: 3px; background: #16233b; opacity: .85; }
.phone.and .hbar { height: 26px; }
.phone.and .hbar i { width: 90px; }

/* 本体 */
.app { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 4px 16px 18px; }
.view::-webkit-scrollbar { display: none; }
.tabbar { flex: none; height: 58px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .95); }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10.5px; color: #8a8f99; font-weight: 700; }
.tabbar button .ic { width: 22px; height: 22px; }
.tabbar button.on { color: var(--indigo); }
.tabbar button.on .ic { color: var(--gold-d); }

/* ヘッダー */
.a-hd { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; }
.a-hd .emblem { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; }
.a-hd h2 { font-size: 19px; letter-spacing: .04em; }
.a-hd small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .04em; margin-top: -2px; }
.a-hd .sp { margin-left: auto; }
.back { border: 0; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--indigo); flex: none; }
.a-title { flex: 1; min-width: 0; }
.a-title h2 { font-size: 17px; line-height: 1.3; }
.a-title small { font-size: 11px; color: var(--muted); }

/* ホーム */
.greet { background: linear-gradient(140deg, var(--indigo-l), var(--indigo-d)); color: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.greet h3 { color: #fff; font-size: 16px; margin-bottom: 4px; }
.greet p { font-size: 12px; color: #cfd8e8; margin: 0; line-height: 1.6; }
.greet::after { content: "吉"; position: absolute; right: 8px; bottom: -24px; font-family: var(--serif); font-size: 96px; font-weight: 900; color: rgba(255, 255, 255, .06); }
.cc { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 11px; width: 100%; text-align: left; box-shadow: var(--shadow-s); transition: transform .12s; }
.cc:active { transform: scale(.985); }
.cc img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.cc .t { flex: 1; min-width: 0; }
.cc .t b { display: block; font-size: 14.5px; color: var(--indigo-d); line-height: 1.35; }
.cc .t small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; line-height: 1.4; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 4px; }
.chip .ic { width: 11px; height: 11px; }
.chip.free { background: var(--green-l); color: var(--green); }
.chip.lock { background: var(--gold-xl); color: var(--gold-d); border: 1px solid var(--gold-l); }
.chip.full { background: var(--indigo); color: var(--gold-l); }
.cc > .ic { color: #b6b0a0; }
.bn { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--gold); background: var(--gold-xl); border-radius: 16px; padding: 12px 14px; width: 100%; text-align: left; margin-top: 4px; }
.bn .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--gold); color: #241a06; display: grid; place-items: center; flex: none; }
.bn b { display: block; font-size: 13.5px; color: var(--indigo-d); }
.bn small { font-size: 11.5px; color: var(--muted); }
.bn .pr { margin-left: auto; font-family: var(--serif); font-weight: 700; color: var(--indigo-d); font-size: 15px; white-space: nowrap; }
.own-all { text-align: center; font-size: 12px; color: var(--green); background: var(--green-l); border-radius: 12px; padding: 10px; font-weight: 700; margin-top: 4px; }
.foot-note { text-align: center; font-size: 10.5px; color: #9aa0ab; margin-top: 14px; line-height: 1.6; }

/* 計算画面 */
.box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-s); }
.box h4 { font-family: var(--sans); font-size: 13px; color: var(--indigo); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.box h4 .ic { color: var(--gold-d); }
.f { margin-bottom: 11px; }
.f label { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.f label output { font-family: var(--serif); font-size: 15px; color: var(--indigo-d); }
.f input[type=range] { width: 100%; accent-color: var(--gold); height: 22px; margin: 0; }
.f input[type=number], .f input[type=text] { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; font-family: inherit; background: #fffdf8; color: var(--indigo-d); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg { display: flex; background: var(--paper-2); border-radius: 10px; padding: 3px; gap: 2px; }
.sg button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sg button.on { background: #fff; color: var(--indigo); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.result { background: linear-gradient(150deg, var(--indigo-l), var(--indigo-d)); color: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; }
.result small { color: #b9c5dc; font-size: 11.5px; }
.result .main { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.2; margin: 2px 0 8px; color: var(--gold-l); }
.result .main span { font-size: 14px; color: #d8dfee; margin-left: 4px; }
.result .sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result .sub div { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 7px 10px; }
.result .sub b { display: block; font-size: 14px; font-family: var(--serif); }
.pgroup { position: relative; margin-bottom: 12px; }
.pgroup .p-hd { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--gold-d); margin: 6px 2px 8px; }
.pgroup .p-hd .ic { width: 14px; height: 14px; }
.pgroup.locked .p-body { filter: blur(3.5px) saturate(.85); pointer-events: none; user-select: none; opacity: .85; max-height: 260px; overflow: hidden; }
.pgroup .cover { display: none; }
.pgroup.locked .cover { display: flex; position: absolute; left: 0; right: 0; top: 24px; bottom: 0; align-items: center; justify-content: center; z-index: 3; background: linear-gradient(180deg, rgba(250, 247, 240, .1), rgba(250, 247, 240, .75)); border-radius: 16px; }
.unlock-btn { border: 0; background: linear-gradient(135deg, #dcae55, var(--gold)); color: #241a06; font-weight: 800; font-size: 13.5px; padding: 11px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(200, 145, 47, .5); display: inline-flex; align-items: center; gap: 6px; }
.unlock-btn:active { transform: scale(.97); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding-top: 6px; }
.bars i { flex: 1; background: linear-gradient(180deg, var(--indigo-l), var(--indigo)); border-radius: 2px 2px 0 0; min-height: 2px; }
.bars-x { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.mini-tbl { width: 100%; font-size: 11.5px; border-collapse: collapse; }
.mini-tbl th { text-align: right; color: var(--muted); font-weight: 700; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.mini-tbl th:first-child, .mini-tbl td:first-child { text-align: left; }
.mini-tbl td { text-align: right; padding: 4px; border-bottom: 1px dashed var(--line); font-family: var(--serif); }
.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { font-family: var(--serif); color: var(--indigo-d); }
.kv.hl b { color: var(--green); }
.save-row { display: flex; gap: 8px; margin-top: 4px; }
.save-btn { flex: 1; border: 1px solid var(--indigo); background: #fff; color: var(--indigo); border-radius: 12px; padding: 9px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 58px 32px 40px 26px; gap: 5px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.item input, .scn input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px; font-size: 12px; font-family: inherit; background: #fffdf8; color: var(--indigo-d); }
.item input:focus, .scn input:focus, .f input:focus { outline: 2px solid var(--gold-l); border-color: var(--gold); }
.phone input[type=number]::-webkit-inner-spin-button, .phone input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.phone input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.item .del { border: 0; background: var(--red-l); color: var(--red); border-radius: 8px; height: 26px; display: grid; place-items: center; }
.item .rt { border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 30px; font-size: 11px; font-weight: 700; color: var(--indigo); }
.add-btn { border: 1px dashed var(--indigo-l); background: transparent; color: var(--indigo); width: 100%; padding: 7px; border-radius: 10px; font-size: 12px; font-weight: 700; margin: 2px 0 8px; }
.scn { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 5px; align-items: center; font-size: 11.5px; margin-bottom: 5px; }
.scn b.l { width: 22px; height: 22px; border-radius: 50%; background: var(--indigo); color: var(--gold-l); display: grid; place-items: center; font-size: 11px; }
.scn .pf { font-family: var(--serif); font-weight: 700; text-align: right; color: var(--indigo-d); }
.scn.best .pf { color: var(--green); }
.scn.best .pf::after { content: " ★"; color: var(--gold-d); }
.scn-h { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 5px; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; font-weight: 700; }

/* 保存 */
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 10px; }
.empty .ic { width: 40px; height: 40px; color: var(--gold-l); display: block; margin: 0 auto 8px; }
.sv { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.sv .t { flex: 1; min-width: 0; }
.sv b { font-size: 13px; display: block; }
.sv small { font-size: 11px; color: var(--muted); display: block; }
.sv .v { font-family: var(--serif); font-weight: 700; color: var(--indigo-d); font-size: 14px; }
.sv .del { border: 0; background: none; color: #b6b0a0; }

/* 設定 */
.grp { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.grp h5 { font-family: var(--sans); font-size: 11px; color: var(--muted); padding: 10px 14px 4px; letter-spacing: .06em; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--text); }
.grp h5 + .row { border-top: 0; }
.row .r { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.row .r.on { color: var(--green); }
.row .ic { color: var(--gold-d); }
.row.link { color: var(--indigo); font-weight: 700; }
.row.danger { color: var(--red); }
.row.danger .ic { color: var(--red); }

/* 課金シート */
.ov { position: absolute; inset: 0; background: rgba(15, 22, 36, .5); z-index: 20; display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ov.show { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; background: #fff; border-radius: 26px 26px 0 0; padding: 12px 18px 20px; transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .3, 1); max-height: 92%; overflow-y: auto; scrollbar-width: none; }
.ov.show .sheet { transform: none; }
.sheet .grab { width: 40px; height: 4px; background: #d8d2c2; border-radius: 3px; margin: 0 auto 12px; }
.pw-hd { text-align: center; }
.pw-hd .lk { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(140deg, var(--indigo-l), var(--indigo-d)); color: var(--gold-l); display: grid; place-items: center; margin: 0 auto 8px; font-size: 24px; box-shadow: inset 0 0 0 2px rgba(200, 145, 47, .6); }
.pw-hd h3 { font-size: 17px; }
.pw-hd p { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.pw-feat { background: var(--paper); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.pw-feat li { font-size: 12.5px; padding: 3px 0 3px 22px; position: relative; }
.pw-feat li::before { content: "✓"; position: absolute; left: 2px; color: var(--green); font-weight: 900; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 14px; margin-bottom: 9px; position: relative; }
.opt.best { border-color: var(--gold); background: var(--gold-xl); }
.opt b { font-size: 13.5px; display: block; color: var(--indigo-d); }
.opt small { font-size: 11px; color: var(--muted); }
.opt .pr { margin-left: auto; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--indigo-d); }
.opt .fl { position: absolute; top: -9px; right: 12px; background: var(--gold); color: #241a06; font-size: 10px; font-weight: 800; padding: 1px 10px; border-radius: 999px; }
.pw-links { display: flex; justify-content: center; gap: 14px; margin-top: 4px; font-size: 11.5px; }
.pw-links button { border: 0; background: none; color: var(--indigo); text-decoration: underline; font-size: 11.5px; padding: 4px; }
.pw-legal { font-size: 10px; color: #9a9fa9; text-align: center; margin-top: 6px; line-height: 1.5; }

/* ストアシート (iOS/Android) */
.store { padding-bottom: 18px; }
.st-ios { text-align: center; }
.st-ios .top { display: flex; align-items: center; gap: 10px; text-align: left; padding: 4px 0 12px; border-bottom: 1px solid #e6e6ea; }
.st-ios .top .emblem { width: 44px; height: 44px; border-radius: 10px; font-size: 22px; }
.st-ios .top b { font-size: 14px; display: block; }
.st-ios .top small { font-size: 11px; color: #777; }
.st-ios .lines { text-align: left; font-size: 12.5px; margin: 10px 0; }
.st-ios .lines div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #f0f0f3; }
.st-ios .lines div span:first-child { color: #777; }
.sand { display: inline-block; background: #ffe9a8; color: #6d5200; border-radius: 6px; font-size: 10px; padding: 0 6px; font-weight: 700; margin-left: 4px; }
.st-ios .paybtn, .st-and .paybtn { width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; margin-top: 8px; }
.st-ios .paybtn { background: #0a84ff; color: #fff; font-family: -apple-system, "Hiragino Sans", sans-serif; }
.st-ios .cancel, .st-and .cancel { border: 0; background: none; color: #0a84ff; font-size: 13px; margin-top: 8px; padding: 6px; }
.st-and { font-family: "Roboto", "Noto Sans JP", sans-serif; }
.st-and .top { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.st-and .top .emblem { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.st-and .top b { font-size: 14px; display: block; }
.st-and .top small { font-size: 11px; color: #777; }
.st-and .gp { font-size: 11px; color: #5f6368; display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.st-and .pay { display: flex; align-items: center; gap: 10px; background: #f1f3f4; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 12.5px; }
.st-and .pay .vs { background: #1a1f71; color: #fff; font-size: 10px; font-weight: 900; font-style: italic; padding: 2px 7px; border-radius: 4px; }
.st-and .paybtn { background: #01875f; color: #fff; }
.st-and .cancel { color: #01875f; }
.st-and .amt { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-top: 1px solid #e8eaed; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid #e2e6ee; border-top-color: var(--indigo); margin: 14px auto 8px; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.st-res { text-align: center; padding: 14px 0 6px; }
.st-res .big { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; font-size: 30px; }
.st-res .big.ok { background: var(--green-l); color: var(--green); }
.st-res .big.ng { background: var(--red-l); color: var(--red); }
.st-res b { font-size: 15px; display: block; }
.st-res p { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.st-res button { border: 0; background: var(--indigo); color: #fff; border-radius: 999px; padding: 10px 26px; font-weight: 700; font-size: 13px; }

/* トースト */
.toast { position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: rgba(20, 30, 50, .92); color: #fff; font-size: 12.5px; padding: 9px 16px; border-radius: 999px; opacity: 0; transition: .25s; z-index: 40; white-space: nowrap; pointer-events: none; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .phone { zoom: .9; }
}
@media (max-width: 380px) {
  .phone { zoom: .82; }
}
