@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

#ff-app, #ff-app * { box-sizing: border-box; }

#ff-app {
  font-family: 'Inter', sans-serif;
  --bg: #0A0F1D; --card: #121A2C; --card-soft: #1A2438; --card-border: rgba(255,255,255,0.06);
  --text: #EEF1F8; --text-dim: #8B93A7; --accent: #5B6EF5; --gold: #E8B94E; --green: #34D399; --red: #F87171;
  display: flex; justify-content: center; padding: 24px 0;
  background: #05070D;
}
#ff-app[data-theme="light"] {
  --bg: #F4F6FB; --card: #FFFFFF; --card-soft: #F0F2F8; --card-border: rgba(15,23,42,0.06);
  --text: #131A2A; --text-dim: #6B7280; --accent: #4C5EF0; --gold: #C9932F; --green: #12946B; --red: #E24545;
  background: #E4E8F1;
}

.ff-phone { position: relative; width: 375px; height: 780px; max-width: 100%; border-radius: 44px; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.ff-statusbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px 4px; font-size: 13px; color: var(--text); font-weight: 600; }
.ff-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; position: relative; }

.ff-screen { display: flex; flex-direction: column; height: 100%; }
.ff-screen-head { padding: 24px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; }
.ff-screen-title { font-family: 'Fraunces', serif; font-size: 22px; color: var(--text); margin: 0; }
.ff-screen-sub { font-size: 12px; color: var(--text-dim); margin: 2px 0 0; }
.ff-screen-content { flex: 1; overflow-y: auto; padding: 0 20px 16px; scrollbar-width: none; }
.ff-screen-content::-webkit-scrollbar { display: none; }

.ff-card { border-radius: 20px; padding: 16px; background: var(--card); border: 1px solid var(--card-border); box-shadow: 0 8px 24px -12px rgba(0,0,0,0.35); }
.ff-card.pad-sm { padding: 14px; }
.ff-card.dim { opacity: 0.7; }

.ff-section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.ff-section-label { font-size: 13px; font-weight: 500; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.ff-section-action { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--accent); background: none; border: none; cursor: pointer; }

.ff-pill { font-size: 9px; padding: 2px 8px; border-radius: 999px; font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.ff-pill.red { background: rgba(248,113,113,0.15); color: var(--red); }
.ff-pill.gold { background: rgba(232,185,78,0.18); color: var(--gold); }
.ff-pill.green { background: rgba(52,211,153,0.15); color: var(--green); }
.ff-pill.dim { background: var(--card-soft); color: var(--text-dim); }

.ff-btn { height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; }
.ff-btn.primary { background: var(--accent); color: #fff; }
.ff-btn.soft { background: var(--card-soft); color: var(--text); }
.ff-btn.danger-soft { background: rgba(248,113,113,0.12); color: var(--red); }
.ff-btn.full { width: 100%; }
.ff-btn.small { height: auto; padding: 5px 10px; font-size: 10px; }
.ff-btn:disabled { opacity: 0.6; cursor: default; }
.ff-btn-icon { width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--card); border: none; cursor: pointer; position: relative; }

.ff-avatar { border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-family: 'Inter'; flex-shrink: 0; box-shadow: 0 0 0 2px var(--card); }

.ff-row { display: flex; align-items: center; }
.ff-row.gap { gap: 12px; }
.ff-col { display: flex; flex-direction: column; }
.ff-flex-1 { flex: 1; min-width: 0; }
.ff-between { display: flex; align-items: center; justify-content: space-between; }

.ff-h-scroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.ff-h-scroll::-webkit-scrollbar { display: none; }

.ff-mono { font-family: 'JetBrains Mono', monospace; }
.ff-serif { font-family: 'Fraunces', serif; }
.ff-dim { color: var(--text-dim); }
.ff-text { color: var(--text); }

.ff-progress { height: 8px; border-radius: 999px; width: 100%; background: var(--card-soft); overflow: hidden; }
.ff-progress > div { height: 100%; border-radius: 999px; }

.ff-nav { display: flex; align-items: center; justify-content: space-around; padding: 8px 12px 24px; background: var(--bg); border-top: 1px solid var(--card-border); }
.ff-nav-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 8px; background: none; border: none; cursor: pointer; }
.ff-nav-btn span { font-size: 9.5px; color: var(--text-dim); }
.ff-nav-btn.active span { color: var(--accent); font-weight: 600; }

.ff-toggle { width: 44px; height: 24px; border-radius: 999px; position: relative; border: none; cursor: pointer; }
.ff-toggle > span { position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 999px; background: #fff; transition: left .15s; }

.ff-sheet-overlay { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.ff-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.ff-sheet { position: relative; border-top-left-radius: 28px; border-top-right-radius: 28px; padding: 20px 20px 28px; background: var(--bg); border-top: 1px solid var(--card-border); max-height: 85%; overflow-y: auto; }
.ff-sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--card-soft); margin: 0 auto 16px; }

.ff-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ff-more-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 16px; background: var(--card); border: none; cursor: pointer; }
.ff-more-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--card-soft); }
.ff-more-item span { font-size: 10.5px; text-align: center; color: var(--text-dim); line-height: 1.2; padding: 0 2px; }

.ff-field { margin-bottom: 12px; }
.ff-field label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; display: block; }
.ff-field input, .ff-field select { width: 100%; height: 44px; border-radius: 12px; padding: 0 12px; font-size: 13px; background: var(--card); color: var(--text); border: 1px solid var(--card-border); font-family: inherit; }

.ff-login-wrap { display: flex; flex-direction: column; height: 100%; justify-content: center; padding: 0 28px; }
.ff-login-wrap h1 { font-family: 'Fraunces', serif; font-size: 26px; color: var(--text); margin: 4px 0 24px; }
.ff-error { font-size: 12px; color: var(--red); margin: 4px 0 0; }

.ff-spin { animation: ff-spin 0.8s linear infinite; }
@keyframes ff-spin { to { transform: rotate(360deg); } }
.ff-loading-center { flex: 1; display: flex; align-items: center; justify-content: center; }

.ff-tabs { display: flex; padding: 4px; border-radius: 999px; background: var(--card-soft); }
.ff-tabs button { flex: 1; height: 36px; border-radius: 999px; border: none; background: none; font-size: 12px; font-weight: 500; color: var(--text-dim); cursor: pointer; }
.ff-tabs button.active { background: var(--accent); color: #fff; }

.ff-donut-wrap { display: flex; align-items: center; }
.ff-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-left: 8px; }
.ff-legend-row { display: flex; align-items: center; justify-content: space-between; }
.ff-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; margin-right: 6px; }

@media (max-width: 420px) {
  .ff-phone { width: 100%; height: 100vh; border-radius: 0; }
  #ff-app { padding: 0; }
}
