/* My Home Booklet — app styles. No external fonts or scripts (privacy, speed, strict CSP). */

:root {
	--navy: #1f3a5f;
	--navy-2: #2c5282;
	--copper: #b8682f;
	--bg: #f6f4ef;
	--card: #ffffff;
	--soft: #eef2f7;
	--text: #22252a;
	--muted: #646b75;
	--line: #e3e0d8;
	--ok: #2f7d4f;
	--ok-bg: #e8f4ec;
	--warn: #9a5b12;
	--warn-bg: #fdf1e2;
	--err: #a12d2d;
	--err-bg: #fbeaea;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .05);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.mhb {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

a { color: var(--navy-2); }
a:hover { color: var(--navy); }

.mhb-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.mhb-header { background: var(--navy); color: #fff; }
.mhb-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.mhb-brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.mhb-brand:hover { color: #fff; }
.mhb-brand__name { font-weight: 700; font-size: 18px; letter-spacing: .1px; }
.mhb-brand__by { font-size: 12.5px; opacity: .8; }
.mhb-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mhb-nav a, .mhb-nav .mhb-link { color: #fff; text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: 8px; opacity: .88; }
.mhb-nav a:hover, .mhb-nav .mhb-link:hover { background: rgba(255, 255, 255, .12); opacity: 1; color: #fff; }
.mhb-nav a[aria-current="page"] { background: rgba(255, 255, 255, .16); opacity: 1; }

/* Main */
.mhb-main { flex: 1; padding-top: 24px; padding-bottom: 40px; }

.mhb-card {
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 24px;
	margin: 0 0 18px;
}
.mhb-card--narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.mhb-card--soft { background: var(--soft); box-shadow: none; }
.mhb-card--danger { border: 1px solid #efcfcf; box-shadow: none; }

h1, h2 { color: var(--navy); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

.mhb-lead { font-size: 17px; color: #3a3f47; }
.mhb-muted { color: var(--muted); font-size: 14px; }
.mhb-small { font-size: 14px; color: var(--muted); }
.mhb-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--copper); margin-bottom: 6px; }
.mhb-icon { font-size: 40px; color: var(--navy); line-height: 1; margin-bottom: 10px; }

.mhb-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Lists */
.mhb-list { padding-left: 20px; margin: 0 0 16px; }
.mhb-list li { margin: 4px 0; }
.mhb-list--check { list-style: none; padding-left: 0; }
.mhb-list--check li { position: relative; padding-left: 28px; }
.mhb-list--check li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: var(--ok); font-weight: 700; }

.mhb-point { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }

.mhb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 0; }
.mhb-facts div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.mhb-facts dt { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mhb-facts dd { margin: 2px 0 0; font-weight: 600; }

/* Countdown */
.mhb-countdown { list-style: none; padding: 0; margin: 0 0 14px; }
.mhb-countdown__item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mhb-countdown__item:last-child { border-bottom: 0; }
.mhb-countdown__main { display: flex; flex-direction: column; }
.mhb-countdown__when { text-align: right; display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-size: 14px; }
.mhb-countdown__num { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.mhb-countdown__item--soon .mhb-countdown__num { color: var(--warn); }
.mhb-countdown__item--ended { opacity: .6; }
.mhb-countdown__item--ended .mhb-countdown__num { font-size: 16px; color: var(--muted); }

.mhb-alert { background: var(--warn-bg); color: #5c3a0e; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }

.mhb-agent { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mhb-agent h2 { margin-bottom: 4px; }

/* Notices */
.mhb-notice { border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }
.mhb-notice--error { background: var(--err-bg); color: var(--err); }
.mhb-notice--success { background: var(--ok-bg); color: var(--ok); }
.mhb-notice--info { background: var(--soft); color: var(--navy); }

/* Forms */
.mhb-form { margin: 8px 0 0; }
.mhb-form fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.mhb-form legend { font-weight: 700; color: var(--navy); font-size: 17px; margin-bottom: 6px; padding: 0; }
.mhb-form label, .mhb-label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 6px; }
.mhb-opt { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.mhb-form input[type="text"],
.mhb-form input[type="email"],
.mhb-form input[type="tel"],
.mhb-form input[type="number"],
.mhb-form input[type="date"] {
	width: 100%;
	font: inherit;
	font-size: 16px; /* 16px stops iPhone zooming in */
	padding: 12px 14px;
	border: 1px solid #cfcbc2;
	border-radius: 10px;
	background: #fff;
	color: var(--text);
	min-height: 48px;
}
.mhb-form input:focus { outline: 3px solid rgba(44, 82, 130, .25); border-color: var(--navy-2); }
.mhb-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) {
	.mhb-row { grid-template-columns: repeat(3, 1fr); }
	.mhb-col-2 { grid-column: span 1; }
}
.mhb-choice label { font-weight: 400; margin: 8px 0; display: flex; gap: 10px; align-items: center; }
.mhb-choice input { width: 20px; height: 20px; }
.mhb-form:has(input[name="home_type"][value="resale"]:checked) .mhb-only-new { display: none; }

.mhb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.mhb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.mhb-inline { display: inline; margin: 0; }

/* Buttons */
.mhb-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 12px 22px;
	background: var(--navy); color: #fff;
	border: 1px solid var(--navy); border-radius: 10px;
	font: inherit; font-weight: 600; font-size: 16px;
	text-decoration: none; cursor: pointer;
}
.mhb-form > .mhb-btn, .mhb-form > button.mhb-btn { width: 100%; margin-top: 18px; }
.mhb-btn:hover { background: var(--navy-2); color: #fff; }
.mhb-btn--ghost { background: transparent; color: var(--navy); border-color: #c9cfd8; }
.mhb-btn--ghost:hover { background: var(--soft); color: var(--navy); }
.mhb-btn--sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.mhb-btn--danger { background: var(--err); border-color: var(--err); }
.mhb-btn--danger:hover { background: #861f1f; }
.mhb-link { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }

/* Prose (privacy page) */
.mhb-prose h2 { margin-top: 24px; }
.mhb-prose ul { padding-left: 20px; }
.mhb-prose li { margin: 6px 0; }

/* Footer */
.mhb-footer { padding: 20px 0 28px; font-size: 14px; }
.mhb-footer .mhb-wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.mhb-footer a { color: var(--muted); text-decoration: none; }
.mhb-footer a:hover { color: var(--navy); text-decoration: underline; }

@media (max-width: 480px) {
	.mhb-card { padding: 20px 16px; }
	h1 { font-size: 23px; }
	.mhb-countdown__item { align-items: flex-start; }
}

/* Spacing for helper text */
.mhb-form + .mhb-small { margin-top: 16px; }
.mhb-form .mhb-small { margin-top: 8px; }

/* ---------- Phase 2: warranty issues ---------- */

.mhb-form select,
.mhb-form textarea {
	width: 100%;
	font: inherit;
	font-size: 16px;
	padding: 12px 14px;
	border: 1px solid #cfcbc2;
	border-radius: 10px;
	background: #fff;
	color: var(--text);
}
.mhb-form select { min-height: 48px; }
.mhb-form textarea { resize: vertical; line-height: 1.45; }
.mhb-form select:focus,
.mhb-form textarea:focus { outline: 3px solid rgba(44, 82, 130, .25); border-color: var(--navy-2); }
.mhb-form input[type="file"] {
	width: 100%;
	font: inherit;
	font-size: 15px;
	padding: 14px;
	border: 2px dashed #c9cfd8;
	border-radius: 10px;
	background: var(--soft);
}
@media (min-width: 560px) {
	.mhb-row--2 { grid-template-columns: 1fr 1fr; }
}
.mhb-choice--stack label { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; }
.mhb-choice--stack input { margin-top: 3px; flex: 0 0 auto; }
.mhb-subform { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 18px; }

.mhb-back { margin: 0 0 12px; font-size: 15px; }
.mhb-back a { text-decoration: none; }
.mhb-claim-title { margin-top: 8px; }
.mhb-desc { white-space: normal; margin-top: 16px; }

/* Status pills */
.mhb-pill { display: inline-block; font-size: 12.5px; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.mhb-pill--open { background: #fdf1e2; color: #8a4f0c; }
.mhb-pill--reported { background: #e6eef8; color: #24497a; }
.mhb-pill--scheduled { background: #ece6f8; color: #4b2f86; }
.mhb-pill--fixed { background: var(--ok-bg); color: var(--ok); }
.mhb-pill--denied { background: #efefef; color: #555; }

/* Issue list */
.mhb-claims { list-style: none; padding: 0; margin: 8px 0 0; }
.mhb-claims__item a { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; margin: 0 -12px; border-radius: 10px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.mhb-claims__item:last-child a { border-bottom: 0; }
.mhb-claims__item a:hover { background: var(--bg); }
.mhb-claims__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mhb-claims__item--closed { opacity: .65; }

.mhb-mini-list { list-style: none; padding: 0; margin: 0 0 14px; }
.mhb-mini-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mhb-mini-list li:last-child { border-bottom: 0; }

/* Coverage note */
.mhb-cover { margin-top: 16px; border-radius: 10px; padding: 12px 14px; background: var(--soft); color: var(--navy); font-size: 15px; }
.mhb-cover--soon { background: var(--warn-bg); color: #5c3a0e; }
.mhb-cover--ended { background: #efefef; color: #555; }

/* Photos */
.mhb-photos { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .mhb-photos { grid-template-columns: repeat(3, 1fr); } }
.mhb-photos li { display: flex; flex-direction: column; gap: 4px; }
.mhb-photos img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--soft); }
.mhb-photos__when { font-size: 12.5px; color: var(--muted); }
.mhb-photos__pick { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* Timeline */
.mhb-timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px solid var(--line); }
.mhb-timeline li { position: relative; padding: 0 0 18px 4px; }
.mhb-timeline li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy-2); border: 2px solid #fff; }
.mhb-timeline__date { display: block; font-weight: 700; font-size: 14px; color: var(--navy); }
.mhb-timeline__status { display: block; margin: 4px 0; font-size: 14px; color: var(--muted); }
.mhb-timeline p { margin: 4px 0 0; }

/* Upgrade prompt */
.mhb-upgrade { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--warn-bg); color: #5c3a0e; }
.mhb-upgrade p { margin: 6px 0 10px; }

/* iPhone: date fields keep their own width unless told otherwise, and overflow the card */
.mhb-form input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	min-width: 0;
	max-width: 100%;
	text-align: left;
}
.mhb-form input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.mhb-row > div { min-width: 0; }

/* ---------- 0.3: contacts and sending ---------- */
.mhb-contacts { list-style: none; padding: 0; margin: 8px 0 0; }
.mhb-contact { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mhb-contact:last-child { border-bottom: 0; }
.mhb-contact__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mhb-contact__main .mhb-eyebrow { margin-bottom: 2px; }
.mhb-contact__lines { display: flex; flex-direction: column; font-size: 15px; }
.mhb-contact__lines a { overflow-wrap: anywhere; }
.mhb-subhead { font-size: 15px; color: var(--navy); margin: 18px 0 0; text-transform: uppercase; letter-spacing: .05em; }
.mhb-tag { display: inline-block; font-size: 11.5px; font-weight: 700; background: var(--warn-bg); color: var(--warn); padding: 3px 8px; border-radius: 999px; vertical-align: middle; }
.mhb-saved { white-space: nowrap; padding-top: 8px; }
.mhb-starters { padding-left: 20px; }
.mhb-starters li { margin: 8px 0; }
.mhb-check { display: flex !important; gap: 10px; align-items: center; font-weight: 400 !important; }
.mhb-check input { width: 20px; height: 20px; flex: 0 0 auto; }
.mhb-mini-list li > span:first-child { min-width: 0; }

/* Security code boxes */
.mhb-form input.mhb-code { width: 100%; font-size: 26px; letter-spacing: .5em; text-align: center; padding: 12px; min-height: 56px; border: 1px solid #cfcbc2; border-radius: 10px; font-family: inherit; }
.mhb-form input.mhb-code:focus { outline: 3px solid rgba(44, 82, 130, .25); border-color: var(--navy-2); }

/* Home Screen tip */
.mhb-tip { border: 2px solid #c9d6e8; background: #f3f7fc; }

/* ---------- 0.5: Home facts ---------- */
.mhb-emergency { border-left: 4px solid var(--copper); }
.mhb-fact-list { list-style: none; padding: 0; margin: 8px 0 0; }
.mhb-fact-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.mhb-fact-list li:last-child { border-bottom: 0; }
.mhb-fact-photos { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mhb-fact-photos li { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; }
.mhb-fact-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.mhb-fact-edit { border-top: 1px solid var(--line) !important; padding-top: 12px !important; }
.mhb-rows { list-style: none; padding: 0; margin: 8px 0 0; }
.mhb-rows li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.mhb-rows li:last-child { border-bottom: 0; }
.mhb-rowset { border: 1px solid var(--line) !important; border-radius: 10px; padding: 4px 12px 12px !important; margin: 0 0 12px !important; }
@media (min-width: 560px) { .mhb-rowset .mhb-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }
.mhb-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 0.6.0: Home Screen helper */
[hidden] { display: none !important; }
.mhb-a2hs { border: 2px solid var(--copper); }
.mhb-a2hs__head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.mhb-a2hs__head img { width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto; }
.mhb-a2hs__head h2 { margin: 0 0 4px; }
.mhb-a2hs__head p { margin: 0; }
.mhb-a2hs__install { margin: 14px 0 4px; }
.mhb-a2hs__install .mhb-btn { width: 100%; }
.mhb-steps { margin: 12px 0; padding-left: 0; list-style: none; counter-reset: step; }
.mhb-steps li { counter-increment: step; position: relative; padding: 10px 0 10px 44px; border-top: 1px solid var(--line); line-height: 1.6; }
.mhb-steps li:first-child { border-top: 0; }
.mhb-steps li::before { content: counter(step); position: absolute; left: 0; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.mhb-key { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #c9cfd8; border-radius: 8px; background: #fff; color: #0a84ff; vertical-align: middle; margin: 0 2px; }
.mhb-a2hs__dismiss { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.mhb-a2hs__dismiss .mhb-small { margin: 0; }
.mhb-standalone .mhb-a2hs { display: none; }

/* Sign-in code */
.mhb-codeform input[name="code"] { font-size: 26px; letter-spacing: 6px; text-align: center; max-width: 220px; }
.mhb-codeform { margin-bottom: 18px; }
.mhb-step-img { display: block; width: 100%; max-width: 360px; height: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }

/* 0.7.0: storage meter */
.mhb-meter { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border: 0; border-radius: 6px; background: var(--soft); overflow: hidden; }
.mhb-meter::-webkit-progress-bar { background: var(--soft); border-radius: 6px; }
.mhb-meter::-webkit-progress-value { background: var(--navy-2); border-radius: 6px; }
.mhb-meter::-moz-progress-bar { background: var(--navy-2); border-radius: 6px; }
.mhb-meter--full::-webkit-progress-value { background: var(--copper); }
.mhb-meter--full::-moz-progress-bar { background: var(--copper); }
.mhb-notice--warn { background: #fdf3e7; color: #7a3e0e; border: 1px solid #f0c99a; }
.mhb-notice--warn a { color: #7a3e0e; font-weight: 600; }

/* 0.8.0: Help */
.mhb-help h1 { margin-bottom: 14px; }
.mhb-help__search input { width: 100%; padding: 13px 14px 13px 42px; font-size: 16px; border: 1px solid #cfcbc2; border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%23646b75' stroke-width='2'/%3E%3Cpath d='M15.5 15.5 21 21' stroke='%23646b75' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 13px center no-repeat; font-family: inherit; }
.mhb-help__search input:focus { outline: 3px solid rgba(44, 82, 130, .25); border-color: var(--navy-2); }
.mhb-help__topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.mhb-help__topics a { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 14px; }
.mhb-help__topics a:hover { background: var(--soft); }
@media (max-width: 520px) { .mhb-help__topics { grid-template-columns: repeat(3, 1fr); } }
.mhb-help__sec { margin-top: 22px; scroll-margin-top: 12px; }
.mhb-help__sec h2 { font-size: 20px; }
.mhb-help__list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mhb-help__q + .mhb-help__q { border-top: 1px solid var(--line); }
.mhb-help__q summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 600; position: relative; }
.mhb-help__q summary::-webkit-details-marker { display: none; }
.mhb-help__q summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.mhb-help__q[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.mhb-help__a { padding: 0 16px 14px; }
.mhb-help__a ol { padding-left: 20px; }
.mhb-help__none { margin: 16px 0; }
.mhb-video { position: relative; width: 100%; height: 820px; max-height: 92vh; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mhb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 721px) { .mhb-video { height: 520px; } }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
