/* Six & Four mobile console. Phone first, with safe-area padding and 44px+ tap targets. */
.sfc, .sfc * { box-sizing: border-box; }
.sfc {
	--bg: #f5f5f7; --surface: #fff; --fill: #f2f2f5; --fg: #1d1d1f; --muted: #6e6e73; --line: rgba(0, 0, 0, .08);
	--navy: #0a1b44; --mint: #25f4b4; --ok: #0b7a5a; --ok-bg: #ddf8ee; --warn: #8a4b00; --warn-bg: #fff0d9; --bad: #b3213a; --bad-bg: #fde3e7;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif; font-size: 16px; line-height: 1.45; color: var(--fg);
	-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; letter-spacing: -.01em;
}
.sfc-full { position: fixed; inset: 0; width: auto !important; max-width: none !important; margin: 0 !important; z-index: 999999; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
html.sfc-lock, body.sfc-page { margin: 0 !important; }
body.sfc-page { overflow: hidden; }
.sfc-noscript { padding: 24px; }

.sfc-top { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: rgba(251, 251, 253, .92); border-bottom: 1px solid var(--line); }
.sfc-top svg.logo { width: 34px; height: 34px; flex: none; }
.sfc-top b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.sfc-top .sp { flex: 1; }
.sfc-pill { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sfc-pill.ok { background: var(--ok-bg); color: var(--ok); }
.sfc-pill.warn { background: var(--warn-bg); color: var(--warn); }
.sfc-pill.bad { background: var(--bad-bg); color: var(--bad); }
.sfc-pill.gray { background: #ececf0; color: #4a4a50; }

.sfc-main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.sfc-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.sfc h2 { margin: 6px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sfc h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sfc-sub { color: var(--muted); font-size: 14px; }

.sfc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sfc-card { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: 0 1px 2px rgba(10, 27, 68, .05), 0 6px 20px rgba(10, 27, 68, .06); min-width: 0; }
.sfc-big { font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.sfc-meter { height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.sfc-meter i { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.sfc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1fd6a0; margin-right: 7px; vertical-align: 2px; }
.sfc-dot.bad { background: #e5484d; }

.sfc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border: 0; border-radius: 999px; background: #e9e9ee; color: var(--navy); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; padding: 0 20px; transition: transform .12s, background .15s; text-decoration: none; }
.sfc-btn:active { transform: scale(.97); }
.sfc-btn.primary { background: var(--navy); color: #fff; }
.sfc-btn.mint { background: var(--mint); color: var(--navy); }
.sfc-btn.sm { min-height: 44px; font-size: 15px; width: auto; }
.sfc-btn[disabled] { opacity: .5; cursor: default; }
.sfc-btn svg { width: 22px; height: 22px; flex: none; }
.sfc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
:focus-visible { outline: 3px solid rgba(37, 244, 180, .85); outline-offset: 2px; }

.sfc-list { background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(10, 27, 68, .05), 0 6px 20px rgba(10, 27, 68, .06); }
.sfc-li { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; }
.sfc-li + .sfc-li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.sfc-li .t { color: var(--muted); font-variant-numeric: tabular-nums; width: 46px; flex: none; font-size: 14px; }
.sfc-li .m { flex: 1; min-width: 0; }
.sfc-li .m b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.sfc-li .m span { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.sfc-li img.th { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; background: var(--fill); }

.sfc-switch { position: relative; width: 56px; height: 34px; flex: none; }
.sfc-switch input { position: absolute; inset: -6px; opacity: 0; width: calc(100% + 12px); height: calc(100% + 12px); margin: 0; z-index: 1; cursor: pointer; }
.sfc-switch span { position: absolute; inset: 0; background: #e4e4e8; border-radius: 999px; transition: background .2s; }
.sfc-switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: transform .2s; }
.sfc-switch input:checked + span { background: var(--mint); }
.sfc-switch input:checked + span::after { transform: translateX(22px); }

.sfc-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(118, 118, 128, .12); border-radius: 12px; padding: 3px; gap: 2px; }
.sfc-seg button { min-height: 44px; border: 0; background: transparent; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600; color: var(--fg); cursor: pointer; }
.sfc-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

.sfc-field { width: 100%; background: var(--fill); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--fg); min-height: 48px; }
.sfc-field:focus { outline: none; border-color: var(--navy); background: #fff; }
textarea.sfc-field { min-height: 110px; resize: vertical; }
.sfc label.l { display: block; font-weight: 600; margin: 0 0 6px; }

.sfc-post { background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(10, 27, 68, .05), 0 6px 20px rgba(10, 27, 68, .06); }
.sfc-post img.full { display: block; width: 100%; height: auto; background: var(--fill); }
.sfc-post .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.sfc-err { color: var(--bad); font-size: 14px; margin: 0; }
.sfc-empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.sfc-empty b { display: block; color: var(--fg); font-size: 19px; margin-bottom: 4px; }

.sfc-pick { display: grid; place-items: center; gap: 6px; min-height: 150px; border: 2px dashed #c8c8d0; border-radius: 20px; background: var(--surface); color: var(--muted); text-align: center; padding: 16px; cursor: pointer; font-weight: 600; }
.sfc-pick svg { width: 34px; height: 34px; color: var(--navy); }
.sfc-pick img { max-width: 100%; max-height: 260px; border-radius: 14px; }
.sfc-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.sfc-tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(251, 251, 253, .94); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.sfc-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: transparent; color: #8a8a90; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 14px; }
.sfc-tabs button svg { width: 26px; height: 26px; }
.sfc-tabs button[aria-current="page"] { color: var(--navy); }
.sfc-tabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--mint); color: var(--navy); font-size: 12px; line-height: 20px; text-align: center; }

.sfc-toast { position: absolute; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); background: rgba(10, 27, 68, .95); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; z-index: 5; box-shadow: 0 10px 30px rgba(10, 27, 68, .3); text-align: center; }
.sfc-toast.bad { background: #8f1d31; }
.sfc-toast[hidden] { display: none; }
.sfc-login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.sfc-login .sfc-card { width: min(100%, 400px); padding: 28px 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.sfc-login svg.logo { width: 64px; height: 64px; margin: 0 auto; }
.sfc-login h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.sfc-login a.plain { color: var(--muted); font-size: 14px; }
.sfc-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #d8d8de; border-top-color: var(--navy); animation: sfc-spin .8s linear infinite; margin: 60px auto; }
@keyframes sfc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sfc * { transition: none !important; animation-duration: 2s !important; } }
@media (min-width: 700px) { .sfc-grid { grid-template-columns: repeat(4, 1fr); } }

/* Desktop: the tab bar becomes a left sidebar. Phones keep the bottom bar. */
@media (min-width: 900px) {
	.sfc-full { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "nav main"; }
	.sfc-top { grid-area: top; padding-left: 24px; padding-right: 24px; }
	.sfc-main { grid-area: main; padding: 28px 40px 40px; }
	.sfc-wrap { max-width: 1040px; }
	.sfc-tabs { grid-area: nav; display: flex; flex-direction: column; gap: 4px; align-content: start; border-top: 0; border-right: 1px solid var(--line); padding: 20px 14px; background: rgba(251, 251, 253, .94); }
	.sfc-tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 16px; font-size: 16px; color: #55555b; text-align: left; }
	.sfc-tabs button:hover { background: rgba(0, 0, 0, .05); }
	.sfc-tabs button[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(10, 27, 68, .12); }
	.sfc-tabs button svg { width: 24px; height: 24px; }
	.sfc-tabs .badge { position: static; margin-left: auto; }
	.sfc-btn { width: auto; min-width: 180px; }
	.sfc-row2 .sfc-btn, .sfc-post .body .sfc-btn { width: 100%; min-width: 0; }
	.sfc-toast { bottom: 28px; left: calc(50% + 120px); }
	.sfc-login .sfc-btn { width: 100%; }
}
@media (min-width: 1280px) {
	.sfc-wrap { max-width: 1160px; }
}
