:root {
  --accent: #245f79;
  --black: #101010;
  --white: #ffffff;
  --muted: #7a7f8c;
  --line: #eceef3;
  --light: #f5f7fa;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: #f5f5f5; color: var(--black); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

#app { min-height: 100vh; }
.page-shell { width: 100%; max-width: 430px; min-height: 100vh; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom)); background: #f5f5f5; }
.profile-card, .section-card { background: var(--white); border: 1px solid #ededed; border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.department-card { position: relative; }
.expand-btn { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 10px; border: none; background: rgba(255,255,255,.95); z-index: 2; }
.department-hero { height: 145px; display: flex; align-items: center; justify-content: center; background: #f8f8f8; border-bottom: 1px solid #f0f0f0; }
.department-hero img { width: 170px; height: 90px; object-fit: contain; }
.profile-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px 10px; }
.avatar { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; background: #eee; flex-shrink: 0; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 900; font-size: 22px; }
.profile-info { min-width: 0; }
.profile-info h1 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.profile-info p { margin: 0 0 3px; color: #666; font-size: 13px; line-height: 18px; }
.profile-info span { font-size: 13px; color: #333; font-weight: 700; }
.action-row { display: flex; gap: 10px; padding: 4px 14px 14px; }
.action { flex: 1; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; font-size: 14px; }
.action.primary { background: var(--accent); color: white; }
.action.secondary { border: 1px solid #e4e4e4; background: white; color: #444; }
.section-card { padding: 16px; }
.section-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 900; }
.bio-text { margin: 0; color: #333; line-height: 22px; font-size: 14px; }
.info-row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #f1f1f1; }
.info-row:last-child { border-bottom: 0; }
.info-row > span { width: 30px; height: 30px; border-radius: 12px; background: #fafafa; display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 900; }
.info-row strong { display: block; color: #777; font-size: 13px; margin-bottom: 3px; }
.info-row p { margin: 0; font-weight: 700; font-size: 14px; color: #111; word-break: break-word; }
.social-row { display: flex; flex-wrap: wrap; gap: 12px; }
.social-btn { width: 52px; height: 52px; border-radius: 14px; background: #f7f7f7; border: 1px solid #ededed; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--accent); }

.state-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: white; }
.state-screen h1 { font-size: 24px; margin: 18px 0 8px; }
.state-screen p { color: var(--muted); margin: 0; }
.loader { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #edf0f5; border-top-color: var(--black); animation: spin 1s linear infinite; }
.error-icon { width: 54px; height: 54px; border-radius: 20px; background: #fff1f2; color: #e43a45; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }

.creator-shell { background: #fff; }
.creator-card { min-height: calc(100vh - 28px); background: #fff; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); }
.creator-cover { height: 118px; background: color-mix(in srgb, var(--accent) 18%, white); display: flex; align-items: center; justify-content: center; }
.creator-cover img { width: 140px; height: 76px; object-fit: contain; }
.creator-avatar-wrap { margin-top: -45px; display: flex; justify-content: center; }
.creator-avatar { width: 92px; height: 92px; border-radius: 46px; border: 5px solid #fff; object-fit: cover; background: #eee; }
.creator-content { padding: 12px 18px 22px; text-align: center; }
.creator-content h1 { margin: 0; font-size: 24px; font-weight: 900; }
.creator-content > p { color: var(--muted); font-weight: 700; margin: 6px 0 0; }
.creator-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.creator-primary, .creator-secondary { height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.creator-primary { background: #111; color: white; }
.creator-secondary { background: #f5f5f5; }
.creator-bio { line-height: 20px; font-size: 13px; }
.feature-card { margin-top: 16px; background: #fafafa; border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.feature-card > span { width: 38px; height: 38px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 18%, white); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.feature-card strong { display: block; }
.feature-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.app-grid a { height: 64px; border-radius: 14px; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent); font-weight: 900; }
.app-grid span { color: #111; font-size: 12px; margin-top: 5px; }

.farm-shell { background: #eef4ee; }
.farm-card { background: #f4f7f1; border-radius: 28px; overflow: hidden; border: 1px solid #e1eadf; }
.farm-cover { height: 136px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.farm-cover img { position: relative; width: 155px; height: 82px; object-fit: contain; z-index: 2; }
.farm-sky { position: absolute; inset: 0 0 auto; height: 70px; background: #bfe3ff; }
.farm-field { position: absolute; left: -30px; right: -30px; bottom: -28px; height: 85px; background: var(--accent); opacity: .22; transform: rotate(-4deg); }
.farm-photo { margin: -10px 12px 0; height: 210px; border-radius: 22px; border: 4px solid white; overflow: hidden; background: white; }
.farm-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.farm-info { margin: 10px 12px 0; background: white; border-radius: 20px; padding: 16px; }
.farm-info h1 { margin: 0; font-size: 22px; }
.farm-info p { margin: 4px 0 10px; color: var(--muted); font-weight: 700; }
.farm-info img { width: 86px; height: 38px; object-fit: contain; }
.farm-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; padding: 12px; }
.white-btn, .green-btn { height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; }
.white-btn { background: white; }
.green-btn { background: var(--accent); color: white; }

.soft-shell { background: #ddefea; }
.soft-card { background: #ddefea; min-height: calc(100vh - 28px); border-radius: 28px; padding: 16px; }
.soft-head h1 { margin: 0; font-size: 26px; color: #12332d; }
.soft-head p { margin: 4px 0 14px; color: #47645d; font-weight: 700; }
.soft-image { height: 260px; border-radius: 18px; overflow: hidden; background: #f4faf8; display: flex; align-items: center; justify-content: center; }
.soft-image img { width: 100%; height: 100%; object-fit: cover; }
.soft-about { display: grid; grid-template-columns: .75fr 1.25fr; gap: 16px; margin-top: 18px; }
.soft-about h2 { margin: 0; color: #12332d; }
.soft-about p { margin: 0; color: #57736c; font-weight: 700; line-height: 20px; }
.soft-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 10px; margin-top: 18px; }
.soft-grid a { height: 74px; border-radius: 14px; background: rgba(255,255,255,.42); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 22px; font-weight: 900; }
.soft-save { grid-row: span 2; flex-direction: column; gap: 8px; background: var(--accent) !important; color: white !important; }
.mini-avatar { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }

.angled-shell { background: #111; }
.angled-card { min-height: calc(100vh - 28px); background: #111; border-radius: 28px; overflow: hidden; color: white; }
.angle-cover { height: 220px; background: color-mix(in srgb, var(--accent) 25%, #111); display: flex; align-items: center; justify-content: center; }
.angle-cover img { width: 180px; height: 100px; object-fit: contain; }
.angle-main { margin: -34px 18px 0; background: #f8f8f8; color: #111; border-radius: 22px; padding: 14px; display: flex; align-items: center; gap: 12px; transform: rotate(-2deg); }
.angle-avatar { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; background: #eee; }
.angle-main h1 { margin: 0; font-size: 24px; line-height: 25px; }
.angle-main p { margin: 6px 0 0; color: #555; font-weight: 700; }
.angle-bio { margin: 18px; background: white; color: #111; border-radius: 22px; padding: 18px; }
.angle-bio h2 { margin: 0 0 8px; }
.angle-bio p { color: #333; line-height: 22px; }
.angle-bio div { display: flex; gap: 10px; margin-top: 14px; }
.angle-bio a { width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 900; }

@media (max-width: 360px) {
  .page-shell { padding-left: 10px; padding-right: 10px; }
  .department-hero { height: 130px; }
  .avatar { width: 78px; height: 78px; }
  .profile-info h1 { font-size: 16px; }
  .action { font-size: 12px; }
}
