:root {
    --ink: #071a35;
    --body: #32445d;
    --muted: #66748a;
    --blue: #0b63ce;
    --blue-dark: #074ba3;
    --line: #d9e1e8;
    --soft-blue: #eef6ff;
    --soft-green: #eef5ed;
    --soft-sand: #fbf4e8;
    --serif: Georgia, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font-family: var(--sans); }
button, input, select { font: inherit; }
a { color: inherit; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 15px; top: -80px; padding: 10px 14px; background: #fff; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,.18); }
.skip-link:focus { top: 15px; }

.personal-header { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.personal-header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.personal-brand img { display: block; width: 205px; height: auto; }
.personal-nav { display: flex; align-items: center; gap: 28px; }
.personal-nav a { color: var(--ink); font-size: .9rem; font-weight: 700; text-decoration: none; }
.personal-nav a:hover, .personal-nav a:focus-visible { color: var(--blue); }
.account-link { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; }
.account-link svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.personal-hero { padding: 72px 0 46px; background: linear-gradient(115deg, #f3f8fb, #fff 57%, #f8f1e8); }
.personal-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 70px; align-items: end; }
.eyebrow { margin: 0 0 12px; color: #3f7668; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.personal-hero h1 { max-width: 760px; margin: 0; font-family: var(--serif); font-size: clamp(2.9rem, 6vw, 5.2rem); font-weight: 500; line-height: .96; letter-spacing: -.04em; }
.personal-hero p:not(.eyebrow) { max-width: 690px; margin: 24px 0 0; color: var(--body); font-size: 1.03rem; line-height: 1.65; }
.hero-note { padding: 24px; border: 1px solid #d7e5df; border-radius: 18px; background: rgba(255,255,255,.75); }
.hero-note strong { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.hero-note p { margin: 0 !important; font-size: .86rem !important; }

.personal-form { padding: 44px 0 80px; }
.personal-step { padding: 34px 0 42px; border-bottom: 1px solid var(--line); }
.step-heading { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 22px; margin-bottom: 26px; }
.step-number { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--serif); font-size: 1.3rem; }
.step-heading h2 { margin: 0 0 7px; font-family: var(--serif); font-size: clamp(2rem, 3vw, 3rem); font-weight: 500; letter-spacing: -.025em; }
.step-heading p { margin: 0; color: var(--muted); line-height: 1.55; }

.location-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(440px, 1.15fr); gap: 28px; align-items: stretch; }
.location-choices { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.location-choices h3, .radius-box h3 { margin: 0 0 14px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.choice-help { margin: -5px 0 18px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.choice-chip { position: relative; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { min-height: 39px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #cad4dc; border-radius: 999px; background: #fff; color: #314258; font-size: .86rem; font-weight: 700; cursor: pointer; transition: .18s ease; }
.choice-chip input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(11,99,206,.18); }
.choice-chip input:focus-visible + span { outline: 3px solid rgba(11,99,206,.25); outline-offset: 2px; }

.preference-map { position: relative; min-height: 440px; overflow: hidden; border-radius: 20px; background: linear-gradient(145deg, #edf4ef, #dce9e2); }
.preference-map::before { content: ""; position: absolute; inset: 0; opacity: .42; background-image: repeating-radial-gradient(ellipse at 30% 35%, transparent 0 26px, #a7c0b4 27px 28px, transparent 29px 49px); }
.map-water { position: absolute; width: 44%; height: 120%; left: -25%; top: -10%; border-radius: 48%; background: #d8eaf0; transform: rotate(-8deg); }
.map-road { position: absolute; inset: 10% 13%; opacity: .6; }
.map-road path { fill: none; stroke: #b0c1b9; stroke-width: 2; }
.map-radius-layer { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.map-radius { position: absolute; box-sizing: border-box; transform: translate(-50%, -50%); border: 1.5px solid rgba(11,99,206,.42); border-radius: 50%; background: rgba(35,128,215,.075); }
.map-radius.is-primary { border: 2px solid rgba(224,112,27,.82); background: rgba(234,139,46,.11); box-shadow: 0 0 0 1px rgba(255,255,255,.45) inset; }
.map-radius b { position: absolute; top: -10px; left: 50%; padding: 3px 7px; transform: translate(-50%, -100%); border-radius: 999px; background: #a94f13; color: #fff; font-size: .67rem; line-height: 1; white-space: nowrap; }
.map-place { position: absolute; z-index: 2; transform: translate(-50%,-50%); border: 0; background: transparent; cursor: pointer; }
.map-place i { width: 27px; height: 27px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #55756c; box-shadow: 0 5px 14px rgba(23,58,49,.25); rotate: -45deg; transition: .18s ease; }
.map-place i::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.map-place span { position: absolute; left: 50%; top: 32px; padding: 3px 7px; transform: translateX(-50%); border-radius: 6px; background: rgba(255,255,255,.87); color: #29423b; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.map-place.is-selected i { background: var(--blue); transform: scale(1.2); }
.map-place.is-primary i { background: #c65f17; transform: scale(1.38); box-shadow: 0 7px 18px rgba(150,67,16,.35); }
.map-place.is-primary span { background: #fff4e9; color: #8f410f; font-weight: 850; }
.map-place:focus-visible { outline: 3px solid rgba(11,99,206,.35); outline-offset: 4px; border-radius: 50%; }

.radius-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-top: 24px; padding: 22px 24px; border-radius: 16px; background: var(--soft-blue); }
.radius-box p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.radius-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.radius-option { position: relative; }
.radius-option input { position: absolute; opacity: 0; }
.radius-option span { min-width: 54px; min-height: 38px; display: grid; place-items: center; border: 1px solid #bfd0e3; border-radius: 999px; background: #fff; font-size: .8rem; font-weight: 750; cursor: pointer; }
.radius-option input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; }

.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.topic-card { position: relative; min-height: 180px; }
.topic-card input { position: absolute; opacity: 0; pointer-events: none; }
.topic-card label { height: 100%; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s, background .18s; }
.topic-card label::before { content: ""; width: 38px; height: 38px; margin-bottom: 28px; border-radius: 12px; background: linear-gradient(135deg, #dfeef8, #eef5ed); box-shadow: inset 0 0 0 1px rgba(31,93,115,.09); }
.topic-card strong { display: block; margin-bottom: 6px; font-family: var(--serif); font-size: 1.18rem; font-weight: 600; }
.topic-card small { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.topic-card input:checked + label { border-color: #3a7cce; background: #f4f9ff; box-shadow: 0 9px 24px rgba(23,73,133,.1); transform: translateY(-2px); }
.topic-card input:checked + label::after { content: "✓"; position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: .8rem; font-weight: 900; }

.feed-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; }
.feed-options { display: grid; gap: 12px; }
.feed-option { position: relative; }
.feed-option input { position: absolute; opacity: 0; }
.feed-option label { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; cursor: pointer; }
.feed-option strong { display: block; margin-bottom: 5px; font-size: .95rem; }
.feed-option span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.feed-option input:checked + label { border-color: var(--blue); background: var(--soft-blue); box-shadow: inset 4px 0 0 var(--blue); }
.feed-preview { padding: 24px; border-radius: 18px; background: #f6f1e9; }
.feed-preview > span { color: #897050; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.feed-preview h3 { margin: 7px 0 18px; font-family: var(--serif); font-size: 1.65rem; font-weight: 500; }
.preview-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid rgba(123,101,71,.18); }
.preview-item i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--blue); }
.preview-item strong { display: block; font-size: .87rem; }
.preview-item small { color: var(--muted); font-size: .72rem; }

.mail-choice { display: flex; gap: 13px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.mail-choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); }
.mail-choice strong { display: block; margin-bottom: 4px; }
.mail-choice span { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.mail-choice.is-disabled { opacity: .64; background: #f5f6f7; }
.mail-login-note { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.mail-login-note a { color: var(--blue); font-weight: 700; }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 30px; }
.action-group { display: flex; align-items: center; gap: 12px; }
.primary-button, .secondary-button, .text-button { min-height: 47px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-weight: 750; cursor: pointer; text-decoration: none; }
.primary-button { padding: 0 22px; border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { padding: 0 20px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.text-button { padding: 0 4px; border: 0; background: transparent; color: var(--muted); }
.save-note, .form-message { margin: 0 0 20px; padding: 14px 17px; border-radius: 12px; background: #eaf6ed; color: #205b35; font-size: .86rem; }
.form-error { background: #fff0ee; color: #8f2823; }

.login-page { min-height: 100vh; background: linear-gradient(120deg, #eef5f8, #fff 55%, #f8efe5); }
.login-main { padding: 64px 0 90px; }
.login-shell { display: grid; grid-template-columns: .9fr 1.1fr; max-width: 1050px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 28px 70px rgba(7,26,53,.1); }
.login-intro { padding: 48px; background: #0c283b; color: #fff; }
.login-intro .eyebrow { color: #9fcabf; }
.login-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4.3rem); font-weight: 500; line-height: .98; }
.login-intro > p:not(.eyebrow) { color: rgba(255,255,255,.72); line-height: 1.65; }
.login-benefits { margin: 36px 0 0; padding: 0; list-style: none; }
.login-benefits li { display: flex; gap: 11px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.82); font-size: .84rem; }
.login-benefits li::before { content: "✓"; color: #9fd0c2; font-weight: 900; }
.login-panel { padding: 42px 48px; }
.login-tabs { display: flex; gap: 7px; margin-bottom: 28px; padding: 5px; border-radius: 12px; background: #f0f3f6; }
.login-tabs a { flex: 1; padding: 10px 12px; border-radius: 9px; text-align: center; text-decoration: none; font-size: .84rem; font-weight: 750; }
.login-tabs a.active { background: #fff; box-shadow: 0 3px 10px rgba(31,50,71,.08); }
.login-panel h2 { margin: 0 0 5px; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.login-panel > p { margin: 0 0 24px; color: var(--muted); font-size: .84rem; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 750; }
.field input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #cbd5dd; border-radius: 10px; color: var(--ink); background: #fff; }
.field input:focus { border-color: var(--blue); outline: 3px solid rgba(11,99,206,.12); }
.password-help { margin: -6px 0 18px; color: var(--muted); font-size: .74rem; }
.login-panel .primary-button { width: 100%; }
.oauth-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; line-height: 1.5; text-align: center; }
.logged-in-card { padding: 20px; border-radius: 14px; background: var(--soft-blue); }
.logged-in-card strong { display: block; margin-bottom: 4px; }
.logged-in-actions { display: grid; gap: 10px; margin-top: 20px; }

@media (max-width: 900px) {
    .personal-nav { display: none; }
    .personal-hero-grid, .location-layout, .feed-layout, .login-shell { grid-template-columns: 1fr; }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .login-intro { padding: 38px; }
}

@media (max-width: 620px) {
    .page-shell { width: min(100% - 24px, 1180px); }
    .personal-header-inner { min-height: 66px; }
    .personal-brand img { width: 165px; }
    .account-link span { display: none; }
    .personal-hero { padding: 48px 0 34px; }
    .personal-hero-grid { gap: 28px; }
    .personal-hero h1 { font-size: 3rem; }
    .step-heading { grid-template-columns: 46px minmax(0, 1fr); gap: 13px; }
    .step-number { width: 40px; height: 40px; }
    .location-layout { grid-template-columns: 1fr; }
    .preference-map { min-height: 350px; }
    .radius-box { grid-template-columns: 1fr; }
    .radius-options { justify-content: flex-start; }
    .topic-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .topic-card { min-height: 165px; }
    .topic-card label { padding: 16px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .action-group { display: grid; }
    .primary-button, .secondary-button { width: 100%; }
    .login-main { padding: 24px 0 50px; }
    .login-intro, .login-panel { padding: 28px 24px; }
}
