:root { color: #263c5a; background: #f5f8ff; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f8ff; }
button, input { font: inherit; }
.hometown-page { width: min(100% - 32px, 620px); margin: 0 auto; padding: 20px 0 calc(34px + env(safe-area-inset-bottom)); }
.hometown-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 38px; }
.hometown-header a { color: #3e6196; font-size: 13px; font-weight: 800; text-decoration: none; }
.hometown-header strong { overflow: hidden; color: #476488; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hometown-hero { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 15px; margin-top: 16px; padding: 23px; border: 1px solid #d8e5ff; border-radius: 16px; color: #fff; background: #315ed1; box-shadow: 0 15px 30px rgba(49, 94, 209, .17); }
.hometown-hero > span { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 16px; color: #315ed1; background: #eef4ff; font-size: 25px; font-weight: 900; }
.hometown-hero p, .hometown-hero h1 { margin: 0; }
.hometown-hero div > p:first-child, .hometown-heading > div > p, .hometown-success > p { font-size: 10px; font-weight: 900; }
.hometown-hero h1 { margin-top: 4px; font-size: 26px; }
.hometown-hero div > p:last-child { margin-top: 7px; color: #d9e5ff; font-size: 13px; line-height: 1.65; }
.hometown-card, .hometown-unavailable { margin-top: 16px; border: 1px solid #dce5f2; border-radius: 16px; background: #fff; box-shadow: 0 10px 24px rgba(36, 58, 95, .05); }
.hometown-leaderboard ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.hometown-leaderboard li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e5ebf5; color: #33445f; }
.hometown-leaderboard li b { color: #4d67a8; font-size: 14px; }
.hometown-leaderboard li strong { color: #245f56; }
.hometown-leaderboard > p { margin: 14px 0 0; color: #71809a; font-size: 14px; }
.hometown-live-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.hometown-live-metrics > div { display: grid; gap: 3px; padding: 12px; border: 1px solid #dce7f7; border-radius: 10px; background: #f8fbff; }
.hometown-live-metrics strong { color: #315ed1; font-size: 23px; font-variant-numeric: tabular-nums; }
.hometown-live-metrics span, .hometown-live-update { color: #71829b; font-size: 10px; line-height: 1.5; }
.hometown-near-unlock { margin-top: 16px; padding: 13px; border: 1px solid #d6e7df; border-radius: 11px; background: #f4fbf7; }
.hometown-near-unlock > strong { color: #2b7257; font-size: 12px; }
.hometown-near-unlock ol { margin-top: 8px; }
.hometown-near-unlock li { grid-template-columns: 1fr auto; padding: 8px 0; font-size: 12px; }
.hometown-live-update { margin-top: 13px !important; }
.hometown-district-ranking { margin-top: 17px; padding-top: 14px; border-top: 1px solid #e5ebf5; }
.hometown-district-ranking > strong { color: #46617f; font-size: 12px; }
.hometown-district-ranking ol { margin-top: 8px; }
.hometown-leaderboard.is-updated { animation: hometown-ranking-update .75s ease-out; }
@keyframes hometown-ranking-update { 0% { outline: 0 solid rgba(35, 126, 93, 0); background: #fff; } 35% { outline: 3px solid rgba(35, 126, 93, .18); background: #f1fbf6; } 100% { outline: 0 solid rgba(35, 126, 93, 0); background: #fff; } }
.hometown-form { padding: 22px; }
.hometown-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hometown-heading p, .hometown-heading h2 { margin: 0; }
.hometown-heading p { color: #5576ad; }
.hometown-heading h2 { margin-top: 4px; color: #293f60; font-size: 19px; }
.hometown-heading > span { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; color: #49724f; background: #eaf7ee; font-size: 10px; font-weight: 800; }
form { display: grid; gap: 13px; margin-top: 20px; }
label { display: grid; gap: 7px; color: #50647f; font-size: 12px; font-weight: 800; }
input { width: 100%; height: 47px; padding: 0 13px; border: 1px solid #cfdaeb; border-radius: 10px; outline: 0; color: #263c5a; background: #fbfcff; font-size: 15px; }
input:focus { border-color: #527be1; box-shadow: 0 0 0 3px rgba(82, 123, 225, .12); }
label small { color: #8290a5; font-size: 10px; font-weight: 500; line-height: 1.55; }
.hometown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hometown-check, .hometown-submit, .hometown-group button { min-height: 46px; border: 0; border-radius: 10px; font-weight: 850; cursor: pointer; }
.hometown-check { color: #365c9e; background: #edf3ff; }
.hometown-match { margin: -3px 0 0; padding: 10px 12px; border-radius: 10px; color: #416a58; background: #edf9f1; font-size: 12px; line-height: 1.5; }
.hometown-progress { display: grid; gap: 9px; margin: -2px 0 2px; padding: 13px; border: 1px solid #d8e4f6; border-radius: 10px; color: #526a8a; background: #f7faff; }
.hometown-progress[hidden], .hometown-draw-result[hidden] { display: none; }
.hometown-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.hometown-progress > div:first-child span { color: #607798; font-size: 11px; font-weight: 750; }
.hometown-progress > div:first-child strong { color: #31557e; font-size: 13px; }
.hometown-progress__track { height: 7px; overflow: hidden; border-radius: 999px; background: #e0e8f5; }
.hometown-progress__track i { display: block; width: 4%; height: 100%; border-radius: inherit; background: #3678ce; transition: width .4s ease; }
.hometown-progress p { margin: 0; color: #73849c; font-size: 11px; line-height: 1.55; }
.hometown-consent { display: flex; align-items: flex-start; gap: 8px; color: #66768e; font-size: 11px; font-weight: 500; line-height: 1.55; }
.hometown-channel { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px; border: 1px solid #d9e3f2; border-radius: 12px; background: #f8fbff; }.hometown-channel legend { padding: 0 4px; color: #637694; font-size: 11px; font-weight: 700; }.hometown-channel label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; margin: 0; border-radius: 8px; color: #536b8d; background: #edf3ff; font-size: 12px; font-weight: 700; }.hometown-channel input { width: 14px; height: 14px; margin: 0; accent-color: #315ed1; }
.hometown-consent input { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: #315ed1; }
.hometown-notice { margin: 0; padding: 11px 12px; border-radius: 10px; color: #737f93; background: #f6f8fc; font-size: 10px; line-height: 1.6; }
.hometown-submit { color: #fff; background: #315ed1; font-size: 14px; }
.hometown-submit:disabled, .hometown-check:disabled { opacity: .6; cursor: wait; }
.hometown-success { padding: 28px 22px; text-align: center; }
.hometown-success > span { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto; border-radius: 16px; color: #fff; background: #2d9b68; font-size: 25px; font-weight: 900; }
.hometown-success > p { margin: 14px 0 0; color: #47946e; }
.hometown-success h2 { margin: 4px 0 0; color: #29493a; font-size: 21px; }
.hometown-success > p:not(:first-of-type) { color: #718076; font-size: 12px; line-height: 1.65; }
.hometown-count { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin-top: 17px; padding: 13px; border-radius: 11px; color: #416a58; background: #edf9f1; }
.hometown-count strong { font-size: 25px; }
.hometown-count span { font-size: 12px; font-weight: 750; }
.hometown-progress--success { margin-top: 15px; text-align: left; }
.hometown-progress--success .hometown-progress__track i { background: #2d9b68; }
.hometown-draw-result { display: grid; gap: 5px; margin-top: 15px; padding: 13px; border: 1px solid #efd89a; border-radius: 11px; color: #715c31; background: #fffaf0; text-align: left; }
.hometown-draw-result strong { font-size: 13px; }
.hometown-draw-result p { margin: 0; font-size: 11px; line-height: 1.55; }
.hometown-group { display: grid; gap: 8px; margin-top: 15px; padding: 15px; border: 1px solid #d9e6fb; border-radius: 12px; background: #f8fbff; text-align: left; }
.hometown-group strong { color: #334c70; font-size: 14px; }
.hometown-group p { margin: 0; color: #60738e; font-size: 12px; }
.hometown-group img { width: min(100%, 180px); justify-self: center; border-radius: 8px; }
.hometown-group button { color: #fff; background: #315ed1; }
.hometown-share { width: 100%; min-height: 45px; margin-top: 15px; border: 0; border-radius: 10px; color: #315eaf; background: #eaf1ff; font-size: 13px; font-weight: 850; cursor: pointer; }
.hometown-secondary { width: 100%; min-height: 42px; margin-top: 9px; border: 1px solid #d4e0f0; border-radius: 10px; color: #496887; background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.hometown-return-hint { margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; color: #47705d; background: #edf8f1; font-size: 10px; line-height: 1.55; text-align: left; }
.hometown-withdraw { margin-top: 17px; border: 0; color: #9a5d5d; background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.hometown-unavailable { display: grid; justify-items: center; padding: 65px 20px; text-align: center; }
.hometown-unavailable[hidden] { display: none; }
.hometown-unavailable > span { display: grid; width: 55px; height: 55px; place-items: center; border-radius: 16px; color: #5574b8; background: #edf3ff; font-size: 23px; font-weight: 900; }
.hometown-unavailable h2 { margin: 17px 0 0; color: #344863; font-size: 19px; }
.hometown-unavailable p { margin: 8px 0 0; color: #7b899b; font-size: 12px; line-height: 1.6; }
.hometown-unavailable a { margin-top: 20px; padding: 12px 18px; border-radius: 10px; color: #fff; background: #315ed1; font-size: 13px; font-weight: 850; text-decoration: none; }
footer { margin-top: 28px; color: #95a0af; font-size: 10px; line-height: 1.6; text-align: center; }
footer p { margin: 3px 0; }
footer a { color: inherit; text-decoration: none; }
.hometown-toast { position: fixed; z-index: 50; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: min(88vw, 480px); padding: 11px 15px; border-radius: 9px; color: #fff; background: rgba(25, 35, 53, .92); font-size: 12px; transform: translateX(-50%); }
@media (max-width: 420px) { .hometown-page { width: min(100% - 24px, 620px); } .hometown-hero, .hometown-form { padding: 18px; } .hometown-hero { grid-template-columns: 48px minmax(0, 1fr); } .hometown-hero > span { width: 48px; height: 48px; } .hometown-hero h1 { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) { .hometown-leaderboard.is-updated { animation: none; } }

/* Softer, native-like visual language shared with the roommate experience. */
:root, body { background: #f5f6f8; }
.hometown-page { width: min(100% - 28px, 620px); }
.hometown-hero, .hometown-card, .hometown-unavailable { border-radius: 24px; box-shadow: 0 12px 28px rgba(31, 50, 82, .07); }
.hometown-hero { border-color: #dce6ff; background: linear-gradient(145deg, #4d75db, #315ed1); }
.hometown-hero > span, input, .hometown-check, .hometown-submit, .hometown-group button, .hometown-match, .hometown-progress, .hometown-notice, .hometown-share, .hometown-secondary { border-radius: 15px; }
input { background: #fff; }
.hometown-form, .hometown-success { padding: 24px; }
.hometown-live-metrics > div, .hometown-near-unlock, .hometown-group, .hometown-draw-result { border-radius: 16px; }
.feature-carousel { overflow: hidden; margin-top: 16px; border: 1px solid #e1e6ee; border-radius: 24px; background: #fff; box-shadow: 0 12px 28px rgba(31, 50, 82, .07); }
.feature-carousel__viewport { overflow: hidden; aspect-ratio: 4 / 1; background: #edf1f5; }
.feature-carousel__track { display: flex; width: 100%; height: 100%; transition: transform .42s ease; }
.feature-carousel__track img { display: block; flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.feature-carousel__footer { display: grid; place-items: center; min-height: 24px; padding: 0 15px; }
.feature-carousel__dots { display: flex; justify-content: center; gap: 5px; }
.feature-carousel__dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: #d4dce9; transition: width .2s, background .2s; }
.feature-carousel__dots button.is-active { width: 18px; background: #315ed1; }
.tech-countdown { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 12px; padding: 13px 16px; border: 1px solid #1e496e; border-radius: 17px; color: #eaf7ff; background: #102b43; box-shadow: 0 12px 28px rgba(16,43,67,.16); }
.tech-countdown[hidden] { display: none; }
.tech-countdown p { margin: 0; color: #b9d5e9; font-size: 11px; font-weight: 800; }
.tech-countdown div { display: flex; align-items: baseline; gap: 5px; }
.tech-countdown b { min-width: 27px; color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; text-align: center; }
.tech-countdown span { color: #86b8d4; font-size: 10px; }
.hometown-my-region { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; margin-top: 14px; padding: 13px; border: 1px solid #bfe2d4; border-radius: 16px; background: #edf9f3; }
.hometown-my-region[hidden] { display: none !important; }
.hometown-my-region > span { grid-column: 1 / -1; color: #47816c; font-size: 10px; font-weight: 850; }
.hometown-my-region strong { color: #245c4b; font-size: 14px; }
.hometown-my-region b { color: #267257; font-size: 15px; }
.hometown-my-region small { grid-column: 1 / -1; color: #668275; font-size: 10px; line-height: 1.45; }

/* The first screen should lead directly into hometown registration, not a dashboard. */
@media (max-width: 420px) {
  .hometown-page { width: min(100% - 24px, 620px); padding-top: 12px; }
  .hometown-header { min-height: 29px; }
  .hometown-header a { font-size: 12px; }
  .hometown-header strong { font-size: 10px; }
  .hometown-hero { grid-template-columns: 37px minmax(0, 1fr); gap: 10px; margin-top: 9px; padding: 14px; border-radius: 20px; }
  .hometown-hero > span { width: 37px; height: 37px; border-radius: 12px; font-size: 18px; }
  .hometown-hero div > p:first-child { font-size: 8px; }
  .hometown-hero h1 { margin-top: 2px; font-size: 22px; }
  .hometown-hero div > p:last-child { margin-top: 4px; font-size: 10px; line-height: 1.45; }
  .tech-countdown { margin-top: 8px; padding: 10px 12px; border-radius: 15px; }
  .tech-countdown p { font-size: 10px; }
  .tech-countdown b { min-width: 22px; font-size: 16px; }
  .hometown-form { margin-top: 10px; padding: 17px 15px; border-radius: 20px; }
  .hometown-heading h2 { margin-top: 2px; font-size: 17px; }
  form { gap: 10px; margin-top: 14px; }
  input { height: 44px; font-size: 14px; }
  .hometown-check, .hometown-submit { min-height: 43px; }
  .hometown-match, .hometown-progress, .hometown-notice { padding: 9px 10px; }
  .hometown-consent { font-size: 10px; }
  .feature-carousel { margin-top: 10px; border-radius: 18px; }
  .feature-carousel__viewport { aspect-ratio: 4 / 1; }
  .feature-carousel__footer { min-height: 22px; padding: 0 12px; }
  .hometown-leaderboard { margin-top: 10px; padding: 17px 15px; border-radius: 20px; }
  .hometown-live-metrics { margin-top: 10px; gap: 7px; }
  .hometown-live-metrics > div { padding: 10px; }
  .hometown-leaderboard > p { margin: 11px 0 0; font-size: 12px; }
.hometown-live-update { margin-top: 10px !important; }
}

/* Compact live-board hierarchy: progress first, then anonymised city rankings. */
.hometown-leaderboard { padding: 20px; }
.hometown-leaderboard .hometown-heading { align-items: center; }
.hometown-leaderboard .hometown-heading > div > p { color: #63789d; letter-spacing: 0; }
.hometown-leaderboard .hometown-heading > span { padding: 7px 10px; border-radius: 999px; color: #356c53; background: #edf8f1; font-size: 11px; }
.hometown-live-metrics { gap: 0; margin-top: 14px; overflow: hidden; border: 1px solid #e1e8f2; border-radius: 14px; background: #fafcff; }
.hometown-live-metrics > div { grid-template-columns: auto 1fr; column-gap: 7px; align-items: baseline; padding: 11px 13px; border: 0; border-radius: 0; background: transparent; }
.hometown-live-metrics > div + div { border-left: 1px solid #e4eaf3; }
.hometown-live-metrics strong { color: #2f5fbe; font-size: 20px; line-height: 1; }
.hometown-live-metrics span { font-size: 11px; white-space: nowrap; }
.hometown-ranking-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hometown-ranking-label strong { color: #2c425f; font-size: 13px; }
.hometown-ranking-label span { color: #8a98ab; font-size: 10px; }
.hometown-near-unlock { margin-top: 14px; padding: 14px; border-color: #dcece4; border-radius: 14px; background: #f8fcfa; }
.hometown-near-unlock > .hometown-ranking-label strong { color: #286a50; }
.hometown-near-unlock ol { gap: 0; margin: 9px 0 0; }
.hometown-near-unlock li { position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0 13px; border-bottom: 0; }
.hometown-near-unlock li + li { border-top: 1px solid #e0eee7; }
.hometown-near-unlock li > div { display: grid; min-width: 0; gap: 2px; }
.hometown-near-unlock li span { overflow: hidden; color: #30445d; font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.hometown-near-unlock li small { color: #7a8c82; font-size: 10px; }
.hometown-near-unlock li b { align-self: center; color: #286a50; font-size: 16px; font-variant-numeric: tabular-nums; }
.hometown-near-unlock li b i { color: #7f9f90; font-size: 11px; font-style: normal; font-weight: 700; }
.hometown-near-unlock li em { position: absolute; right: 0; bottom: 5px; left: 0; height: 3px; overflow: hidden; border-radius: 999px; background: #dfeee5; }
.hometown-near-unlock li em i { display: block; height: 100%; border-radius: inherit; background: #58a77d; }
.hometown-city-ranking { margin-top: 18px; }
.hometown-city-ranking ol, .hometown-district-ranking ol { gap: 0; margin-top: 7px; }
.hometown-city-ranking li, .hometown-district-ranking li { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; min-height: 47px; padding: 0; border-bottom: 1px solid #edf0f5; }
.hometown-city-ranking li b, .hometown-district-ranking li b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; color: #6175a2; background: #f0f4fb; font-size: 11px; font-variant-numeric: tabular-nums; }
.hometown-city-ranking li span, .hometown-district-ranking li span { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.hometown-city-ranking li strong, .hometown-district-ranking li strong { color: #27675e; font-size: 13px; font-variant-numeric: tabular-nums; }
.hometown-district-ranking { margin-top: 18px; padding-top: 0; border-top: 0; }
.hometown-live-update { color: #8a96a6; font-size: 10px; }
@media (max-width: 420px) {
  .hometown-leaderboard { padding: 16px 14px; }
  .hometown-live-metrics > div { padding: 10px; }
  .hometown-live-metrics strong { font-size: 18px; }
  .hometown-live-metrics span { font-size: 10px; }
  .hometown-near-unlock { padding: 12px; }
}

/* Keep the disabled state informative without turning it into an oversized empty card. */
.hometown-unavailable { grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; justify-items: stretch; gap: 12px; padding: 18px; border-color: #e2e7ef; background: #fff; text-align: left; }
.hometown-unavailable > span { width: 46px; height: 46px; border-radius: 14px; color: #667faa; background: #f0f3f8; font-size: 19px; }
.hometown-unavailable > div { min-width: 0; }
.hometown-unavailable > div > p:first-child { margin: 0; color: #8292a8; font-size: 10px; font-weight: 800; }
.hometown-unavailable h2 { margin: 3px 0 0; color: #354861; font-size: 16px; }
.hometown-unavailable > div > p:last-child { margin: 4px 0 0; color: #78879b; font-size: 11px; line-height: 1.5; }
.hometown-unavailable a { display: inline-flex; align-items: center; gap: 4px; justify-self: end; margin: 0; padding: 9px 10px; border-radius: 11px; color: #3c63bb; background: #edf2ff; font-size: 11px; white-space: nowrap; }
.hometown-unavailable a b { font-size: 13px; }
@media (max-width: 420px) {
  .hometown-unavailable { grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 15px; }
  .hometown-unavailable > span { width: 42px; height: 42px; font-size: 18px; }
  .hometown-unavailable a { grid-column: 2; justify-self: start; margin-top: 2px; }
}
