:root {
  --navy-950: #041923;
  --navy-900: #082a3e;
  --navy-800: #0b3d58;
  --navy-700: #11516f;
  --teal-700: #0b7777;
  --teal-600: #0e8f8d;
  --teal-100: #dff4f1;
  --gold-600: #b88219;
  --gold-500: #d3a53a;
  --gold-100: #fff3d1;
  --green-700: #166534;
  --green-100: #dcfce7;
  --red-700: #a3261c;
  --red-100: #fee7e2;
  --amber-800: #854d0e;
  --amber-100: #fef3c7;
  --ink: #102a3d;
  --muted: #607284;
  --surface: #fffefb;
  --surface-2: #f9f5ee;
  --background: #f3efe7;
  --line: #ded5c8;
  --line-strong: #cfc3b4;
  --shadow-sm: 0 5px 16px rgba(4, 25, 35, .07);
  --shadow-md: 0 16px 40px rgba(4, 25, 35, .12);
  --shadow-lg: 0 28px 80px rgba(4, 25, 35, .22);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-width: 1420px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0, rgba(211, 165, 58, .12), transparent 34rem),
    linear-gradient(180deg, #f7f3ec 0, var(--background) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.has-mobile-nav { padding-bottom: calc(82px + var(--safe-bottom)); }
body.sheet-open, body.install-help-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
a { color: var(--teal-700); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.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;
}

.boot-screen, .confirmation-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.boot-screen { align-content: center; gap: 18px; text-align: center; color: var(--muted); }
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(8, 42, 62, .15);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--navy-900); font-size: 1.08rem; font-weight: 900; letter-spacing: -.02em; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy-950);
  background: linear-gradient(145deg, #f1cb71, var(--gold-500));
  border: 1px solid rgba(8, 42, 62, .16);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(8, 42, 62, .15);
  font-size: .86rem;
  font-weight: 950;
}
.brand-lockup.inverse { color: #fff; }
.brand-lockup.inverse .brand-mark { box-shadow: none; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 16px;
  color: var(--navy-900);
  background: #e9eef1;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .nav-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(14, 143, 141, .28);
  outline-offset: 2px;
}
.button.primary { color: #fff; background: linear-gradient(130deg, var(--navy-900), var(--navy-700)); box-shadow: 0 10px 22px rgba(8, 42, 62, .18); }
.button.teal { color: #fff; background: linear-gradient(130deg, var(--teal-700), var(--teal-600)); }
.button.gold { color: var(--navy-950); background: linear-gradient(130deg, #e5bd59, var(--gold-500)); }
.button.success { color: #fff; background: var(--green-700); }
.button.danger { color: #fff; background: var(--red-700); }
.button.light { color: var(--navy-900); background: #fff; border-color: var(--line); }
.button.ghost { color: inherit; background: transparent; border-color: currentColor; }
.button.compact { min-height: 40px; padding: 7px 12px; border-radius: 12px; font-size: .86rem; }
.button.icon { width: 44px; min-width: 44px; padding: 0; }
.button.block { width: 100%; }
.button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.install-button { color: var(--navy-950); background: var(--gold-500); }

.field { display: grid; gap: 6px; }
.field > label, .field-label { color: var(--navy-900); font-size: .78rem; font-weight: 850; }
.field small, .help { color: var(--muted); font-size: .74rem; line-height: 1.35; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; min-height: 20px; accent-color: var(--teal-700); }
input[type="file"] { padding: 9px; }
.form-grid { display: grid; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.form-actions .button { flex: 1 1 160px; }
.check-row { min-height: 44px; display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row label { flex: 1; cursor: pointer; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 17px;
  background: rgba(255, 254, 251, .97);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-title { margin: 0 0 4px; color: var(--navy-900); font-size: 1.15rem; letter-spacing: -.025em; }
.card-subtitle { margin: 0; color: var(--muted); font-size: .82rem; }
.section-stack { display: grid; gap: 14px; }
.section-stack > .card { margin: 0; }

.notice { border: 1px solid #b9dfe1; border-left: 5px solid var(--teal-600); border-radius: 14px; padding: 12px 13px; color: #17444e; background: #edf9f8; }
.notice.success { border-color: #b6e5c3; border-left-color: var(--green-700); color: #175a2d; background: #effbf2; }
.notice.warning { border-color: #efd99b; border-left-color: var(--gold-600); color: var(--amber-800); background: #fff9e8; }
.notice.danger { border-color: #efc2bb; border-left-color: var(--red-700); color: #7e2119; background: #fff3f1; }
.notice p:last-child { margin-bottom: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border-radius: 999px; padding: 5px 9px; color: var(--navy-800); background: #e7edf1; font-size: .72rem; font-weight: 850; line-height: 1.15; }
.badge.success { color: var(--green-700); background: var(--green-100); }
.badge.warning { color: var(--amber-800); background: var(--amber-100); }
.badge.danger { color: var(--red-700); background: var(--red-100); }
.badge.gold { color: #714b06; background: var(--gold-100); }

.public-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  color: #fff;
  background: rgba(8, 42, 62, .96);
  box-shadow: 0 8px 30px rgba(4, 25, 35, .2);
  backdrop-filter: blur(14px);
}
.public-header-actions { display: flex; gap: 7px; }
.public-header .button { min-height: 42px; padding: 8px 11px; font-size: .8rem; }
.public-header .button.light { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }

.public-main { width: min(100%, 1260px); margin: 0 auto; padding: 18px 14px 48px; }
.hero { display: grid; gap: 18px; align-items: center; padding: 28px 0 22px; }
.hero-copy { display: grid; gap: 16px; }
.eyebrow { width: fit-content; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 10px; color: var(--teal-700); background: var(--teal-100); font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; color: var(--navy-950); font-size: clamp(2.35rem, 12vw, 5rem); line-height: .98; letter-spacing: -.06em; }
.hero h1 span { color: var(--gold-600); }
.hero p { max-width: 680px; margin: 0; color: #3f5669; font-size: 1.02rem; line-height: 1.62; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-actions .button { flex: 1 1 145px; }
.hero-panel { position: relative; overflow: hidden; color: #fff; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(150deg, var(--navy-900), #0b4a64); box-shadow: var(--shadow-md); }
.hero-panel::after { content: ""; position: absolute; width: 220px; height: 220px; right: -95px; top: -90px; border-radius: 50%; background: rgba(211,165,58,.22); }
.hero-panel h2 { position: relative; margin: 0 0 14px; }
.steps { position: relative; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; color: var(--navy-950); background: var(--gold-500); font-weight: 900; }
.step p { margin: 2px 0 0; color: rgba(255,255,255,.78); font-size: .85rem; }
.public-section { padding: 26px 0; }
.section-heading { display: grid; gap: 7px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; color: var(--navy-950); font-size: clamp(1.65rem, 7vw, 2.5rem); letter-spacing: -.045em; }
.section-heading p { max-width: 700px; margin: 0; color: var(--muted); }
.plan-grid { display: grid; gap: 14px; }
.plan-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; min-height: 100%; }
.plan-card.featured { border: 2px solid var(--gold-500); box-shadow: 0 20px 46px rgba(184,130,25,.18); }
.plan-ribbon { position: absolute; top: 13px; right: 13px; border-radius: 999px; padding: 5px 9px; color: #684506; background: var(--gold-100); font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.plan-card h3 { margin: 0; padding-right: 74px; color: var(--navy-900); font-size: 1.25rem; }
.plan-price { color: var(--navy-950); font-size: 1.85rem; font-weight: 950; letter-spacing: -.04em; }
.clean-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.clean-list li { position: relative; padding-left: 23px; color: #42586a; font-size: .86rem; }
.clean-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal-700); font-weight: 950; }
.trust-grid { display: grid; gap: 12px; }
.trust-card { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: start; }
.trust-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--navy-900); background: var(--gold-100); font-weight: 900; }
.trust-card h3 { margin: 0 0 3px; font-size: 1rem; }
.trust-card p { margin: 0; color: var(--muted); font-size: .82rem; }

.auth-shell { min-height: calc(100vh - 66px); min-height: calc(100dvh - 66px); display: grid; align-items: center; padding: 18px 14px calc(28px + var(--safe-bottom)); }
.auth-card { width: min(100%, 470px); margin: 0 auto; padding: 20px; }
.auth-card .brand-lockup { margin-bottom: 18px; }
.auth-title { margin: 0 0 6px; color: var(--navy-950); font-size: 1.75rem; letter-spacing: -.04em; }
.auth-copy { margin: 0 0 18px; color: var(--muted); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 17px; padding: 5px; border-radius: 15px; background: #ece7de; }
.auth-tab { min-height: 42px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-weight: 850; cursor: pointer; }
.auth-tab.active { color: var(--navy-900); background: #fff; box-shadow: var(--shadow-sm); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 13px; font-size: .8rem; }

.app-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(9px + var(--safe-top)) 12px 9px;
  color: #fff;
  background: rgba(8, 42, 62, .97);
  box-shadow: 0 8px 28px rgba(4,25,35,.22);
  backdrop-filter: blur(14px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: none; min-width: 0; text-align: right; }
.topbar-user strong, .topbar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user small { color: rgba(255,255,255,.66); font-size: .68rem; }
.app-topbar .button.light { color: #fff; background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.18); }
.app-layout { width: min(100%, var(--content-width)); margin: 0 auto; }
.desktop-sidebar { display: none; }
.app-main { min-width: 0; padding: 14px 12px calc(24px + var(--safe-bottom)); }
.page-header { display: grid; gap: 11px; margin-bottom: 14px; }
.page-header h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.55rem, 7vw, 2.3rem); line-height: 1.08; letter-spacing: -.045em; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.page-actions { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.page-actions::-webkit-scrollbar { display: none; }
.page-actions .button { flex: 0 0 auto; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stat-card { min-width: 0; padding: 14px; }
.stat-label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { margin-top: 4px; color: var(--navy-950); font-size: 1.65rem; font-weight: 950; letter-spacing: -.05em; }
.stat-card.alert .stat-value { color: var(--red-700); }
.stat-card.good .stat-value { color: var(--green-700); }
.quick-grid { display: grid; gap: 10px; }
.quick-action { min-height: 92px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; text-align: left; }
.quick-action .trust-icon { background: var(--teal-100); }
.quick-action strong { display: block; color: var(--navy-900); }
.quick-action small { color: var(--muted); }

.mobile-nav {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(70px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 2px;
  padding: 5px 5px calc(5px + var(--safe-bottom));
  border-top: 1px solid rgba(8,42,62,.12);
  border-radius: 20px 20px 0 0;
  background: rgba(255,255,255,.97);
  box-shadow: 0 -12px 30px rgba(4,25,35,.15);
  backdrop-filter: blur(16px);
}
.nav-button { min-width: 0; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 14px; padding: 5px 2px; color: #6c7b89; background: transparent; cursor: pointer; }
.nav-button.active { color: var(--navy-900); background: #eaf3f4; }
.nav-icon { font-size: 1.15rem; line-height: 1; }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .58rem; font-weight: 850; }

.sheet-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; align-items: end; background: rgba(4,25,35,.6); backdrop-filter: blur(5px); opacity: 0; transition: opacity .18s ease; }
.sheet-backdrop.open { opacity: 1; }
.action-sheet { width: 100%; max-height: min(86vh, 760px); overflow: auto; padding: 12px 14px calc(16px + var(--safe-bottom)); border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .2s ease; }
.sheet-backdrop.open .action-sheet { transform: translateY(0); }
.sheet-handle { width: 46px; height: 5px; margin: 0 auto 14px; border-radius: 999px; background: #c6c0b8; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-header h2 { margin: 0; font-size: 1.25rem; }
.sheet-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.sheet-menu .nav-button { min-height: 76px; border: 1px solid var(--line); background: #fff; }
.sheet-menu .nav-label { font-size: .75rem; }

.data-list { display: grid; gap: 10px; }
.data-card { border: 1px solid var(--line); border-radius: 15px; padding: 13px; background: #fff; box-shadow: 0 4px 14px rgba(4,25,35,.05); }
.data-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.data-card-title { min-width: 0; }
.data-card-title strong { display: block; overflow-wrap: anywhere; color: var(--navy-900); }
.data-card-title small { display: block; margin-top: 2px; color: var(--muted); }
.data-meta { display: grid; gap: 7px; }
.meta-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 10px; align-items: start; font-size: .8rem; }
.meta-row > span:first-child { color: var(--muted); font-weight: 750; }
.meta-row > span:last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.data-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.data-actions .button { flex: 1 1 110px; }
.empty-state { padding: 24px 16px; border: 1px dashed var(--line-strong); border-radius: 16px; text-align: center; color: var(--muted); background: rgba(255,255,255,.55); }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--navy-900); }

.report-card { overflow: hidden; }
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report-date { color: var(--muted); font-size: .76rem; }
.report-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.photo-link { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #e7e2da; }
.photo-link img { width: 100%; height: 100%; display: block; object-fit: cover; }

.chat-window { max-height: min(58vh, 560px); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #f5f7f8; }
.chat-message { max-width: 88%; align-self: flex-start; border: 1px solid #dce3e6; border-radius: 16px 16px 16px 5px; padding: 9px 11px; background: #fff; box-shadow: 0 3px 10px rgba(4,25,35,.05); }
.chat-message.mine { align-self: flex-end; color: #fff; border-color: var(--navy-900); border-radius: 16px 16px 5px 16px; background: var(--navy-900); }
.chat-message strong, .chat-message time { display: block; }
.chat-message time { margin-top: 5px; color: var(--muted); font-size: .65rem; }
.chat-message.mine time { color: rgba(255,255,255,.64); }
.chat-message p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.chat-form textarea { min-height: 48px; max-height: 150px; }

.service-builder { display: grid; gap: 8px; }
.service-row { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 9px; background: #fff; }
.service-row label { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: .8rem; }
.service-row input[type="number"] { min-height: 42px; }
.total-box { display: grid; gap: 5px; border-radius: 15px; padding: 13px; color: #654305; background: var(--gold-100); }
.total-box strong { font-size: 1.22rem; }

.plan-payment { border: 2px solid rgba(211,165,58,.5); }
.payment-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.contact-value { font-weight: 800; overflow-wrap: anywhere; }

.toast-region { position: fixed; z-index: 150; left: 12px; right: 12px; top: calc(12px + var(--safe-top)); display: grid; gap: 8px; pointer-events: none; }
.toast { width: min(100%, 500px); margin-left: auto; border-radius: 14px; padding: 11px 13px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow-md); animation: toast-in .18s ease; pointer-events: auto; }
.toast.success { background: var(--green-700); }
.toast.danger { background: var(--red-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.offline-banner { position: fixed; z-index: 120; left: 12px; right: 12px; bottom: calc(88px + var(--safe-bottom)); border-radius: 15px; padding: 12px 14px; color: #fff; background: #8f2c24; box-shadow: var(--shadow-md); font-size: .8rem; font-weight: 800; }
.update-card { position: fixed; z-index: 125; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 17px; padding: 11px 12px; color: #fff; background: linear-gradient(130deg,var(--navy-900),var(--teal-700)); box-shadow: var(--shadow-lg); }
.update-card strong, .update-card small { display: block; }
.update-card small { color: rgba(255,255,255,.7); font-size: .69rem; }

.install-help { position: fixed; z-index: 140; inset: 0; display: grid; align-items: end; background: rgba(4,25,35,.66); backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s ease; }
.install-help.open { opacity: 1; }
.install-help-card { width: 100%; max-height: min(88vh,760px); overflow: auto; border-radius: 26px 26px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom)); background: #fff; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .2s ease; }
.install-help.open .install-help-card { transform: translateY(0); }
.install-help-logo { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 22px; color: var(--navy-950); background: linear-gradient(145deg,#f1cb71,var(--gold-500)); font-size: 1.15rem; font-weight: 950; }
.install-help-card h2 { margin: 0 0 12px; text-align: center; color: var(--navy-950); letter-spacing: -.035em; }
.install-help-card ol { display: grid; gap: 8px; margin: 0 0 14px; padding-left: 1.35rem; }
.install-help-card li { padding-left: 3px; color: #41576a; }
.install-help-close { position: absolute; right: 14px; top: 14px; }
.install-help-note { border-radius: 13px; padding: 10px; color: #244f59; background: var(--teal-100); font-size: .76rem; }

.confirmation-card { width: min(100%, 520px); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; text-align: center; background: var(--surface); box-shadow: var(--shadow-lg); }
.confirmation-card .brand-lockup { margin-bottom: 18px; }
.confirmation-card h1 { margin: 0 0 10px; color: var(--navy-950); font-size: 1.8rem; letter-spacing: -.04em; }
.confirmation-card p { margin: 0 0 20px; color: var(--muted); }

@media (min-width: 560px) {
  .public-header, .app-topbar { padding-inline: 20px; }
  .public-main { padding-inline: 20px; }
  .hero-actions .button { flex: 0 0 auto; }
  .plan-grid, .trust-grid, .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field.span-all { grid-column: 1 / -1; }
  .photo-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .toast-region { left: auto; width: min(500px, calc(100vw - 24px)); }
}

@media (min-width: 780px) {
  body.has-mobile-nav { padding-bottom: 0; }
  .hero { grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); min-height: 560px; padding-block: 48px; }
  .plan-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .trust-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .auth-shell { padding-block: 42px; }
  .auth-card { padding: 28px; }
  .app-main { padding: 22px 22px 48px; }
  .page-header { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .page-actions { justify-content: flex-end; }
  .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .data-list.desktop-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photo-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .mobile-nav { display: none; }
  .offline-banner { bottom: 18px; left: 18px; right: auto; width: min(440px,calc(100vw - 36px)); }
  .update-card { left: auto; right: 18px; width: min(480px,calc(100vw - 36px)); }
  .install-help { place-items: center; padding: 18px; }
  .install-help-card { position: relative; width: min(100%,440px); border-radius: 26px; padding: 22px; transform: translateY(12px) scale(.98); }
  .install-help.open .install-help-card { transform: translateY(0) scale(1); }
}

@media (min-width: 1040px) {
  .topbar-user { display: block; max-width: 200px; }
  .app-layout { display: grid; grid-template-columns: 248px minmax(0,1fr); gap: 18px; padding: 18px; }
  .desktop-sidebar { position: sticky; top: calc(84px + var(--safe-top)); align-self: start; height: calc(100vh - 102px - var(--safe-top)); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: 22px; padding: 12px; background: rgba(255,254,251,.94); box-shadow: var(--shadow-sm); }
  .desktop-sidebar .nav-button { min-height: 48px; grid-template-columns: 24px 1fr; justify-content: start; align-content: center; place-items: center start; padding: 8px 11px; text-align: left; }
  .desktop-sidebar .nav-label { font-size: .78rem; }
  .sidebar-spacer { flex: 1; }
  .app-main { padding: 3px 0 44px; }
  .plan-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .plan-card h3 { font-size: 1.08rem; }
  .plan-price { font-size: 1.45rem; }
  .data-list.desktop-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (min-width: 1320px) {
  .app-layout { grid-template-columns: 270px minmax(0,1fr); }
  .stat-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (display-mode: standalone) {
  .public-header, .app-topbar { padding-top: calc(10px + var(--safe-top)); }
}

/* Componenti applicativi aggiuntivi */
.brand-button { appearance: none; border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; }
.compact-boot { min-height: 48vh; }
.desktop-copy { display: none; }
.stat-card, .quick-action {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255,254,251,.97);
  box-shadow: var(--shadow-sm);
}
.quick-action { padding: 14px; cursor: pointer; }
.quick-action > span:first-child { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--navy-900); background: var(--teal-100); font-size: 1.1rem; font-weight: 900; }
.quick-action:hover { border-color: #b8d8d7; transform: translateY(-1px); }
.danger-nav { color: var(--red-700); }
.action-sheet.open { transform: translateY(0); }
.split-grid { display: grid; gap: 14px; }
.split-grid > .card { margin: 0; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.fieldset-reset { min-width: 0; margin: 0; border: 0; padding: 0; }
.fieldset-reset legend { margin-bottom: 8px; }
.focus-card { border: 2px solid rgba(14,143,141,.38); box-shadow: var(--shadow-md); }
.route-list { margin-top: 14px; }
.custom-plan-layout { align-items: start; }
.card .notice + form, .card form + form, .notice + .payment-buttons, .field + .payment-buttons { margin-top: 14px; }
.auth-card > .notice { margin-bottom: 14px; }
.auth-links button { border: 0; padding: 4px 0; color: var(--teal-700); background: transparent; font-weight: 800; cursor: pointer; }
.stat-card .button { width: 100%; margin-top: 9px; }
.stat-card .help { display: block; margin-top: 5px; }
.page-header + .stat-grid, .stat-grid + .quick-grid, .quick-grid + .card, .page-header + .card, .page-header + .split-grid, .notice + .section-stack, .split-grid + .card { margin-top: 14px; }
.section-stack > .card-header { margin: 0; }
.trust-card > .contact-value, .trust-card > p { grid-column: 2; }

@media (min-width: 560px) {
  .split-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 780px) {
  .desktop-copy { display: inline; }
}

@media (min-width: 1040px) {
  .custom-plan-layout { grid-template-columns: minmax(360px,.85fr) minmax(0,1.15fr); }
}
