:root {
  --bg: #05070b;
  --bg-soft: #0b0f18;
  --card: rgba(12, 16, 28, .78);
  --card-strong: rgba(18, 23, 38, .92);
  --border: rgba(255, 255, 255, .13);
  --text: rgba(255, 255, 255, .91);
  --muted: rgba(255, 255, 255, .66);
  --green: #d8ff98;
  --green-2: #a6ff6b;
  --purple: #7c4dff;
  --danger: #ff8ba7;
  --shadow: 0 22px 80px rgba(124, 77, 255, .18), 0 10px 40px rgba(166, 255, 107, .08);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); color: var(--text); }
body {
  margin: 0;
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 5%, rgba(124, 77, 255, .28), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(166, 255, 107, .14), transparent 28%),
    linear-gradient(180deg, #070912 0%, var(--bg) 62%);
}

a { color: var(--green); }
button, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.desktop-gate { display: none; }
.mobile-app { min-height: 100svh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(5, 7, 11, .78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.topbar-title { font-weight: 800; letter-spacing: -.02em; }
.icon-button, .ghost-button, .menu-close {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 10px 13px;
  cursor: pointer;
}
.ghost-button.small { padding: 8px 10px; font-size: 12px; }

.screen { display: none; padding: 16px 16px calc(26px + env(safe-area-inset-bottom)); }
.screen.is-active { display: block; }
.screen-chat { padding-top: 12px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); height: calc(100svh - 64px - env(safe-area-inset-top)); }

.card {
  width: 100%;
  margin: 0 auto 14px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(16, 20, 35, .86), rgba(8, 11, 18, .74));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card { text-align: center; padding: 18px 18px 18px; }
.hero-visual-wrap {
  margin: -2px auto 14px;
  width: min(100%, 370px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 60px rgba(124, 77, 255, .14), 0 10px 30px rgba(166, 255, 107, .1);
}
.hero-visual { display: block; width: 100%; height: auto; }
.claim {
  margin: 0 0 8px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 900;
}
h1, h2, p { margin-top: 0; }
.hero h1 { margin-bottom: 3px; font-size: clamp(34px, 12vw, 52px); line-height: .93; letter-spacing: -.07em; }
.subtitle { color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.main-line { color: rgba(255,255,255,.84); font-size: 17px; line-height: 1.38; margin-bottom: 16px; }

.composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.chat-composer-slot .composer {
  margin-top: 0;
}
.chat-composer-slot .primary-button {
  width: 100%;
}
.chat-composer-slot textarea {
  min-height: 108px;
}
textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  color: var(--text);
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  padding: 15px;
  outline: none;
  line-height: 1.4;
}
textarea:focus { border-color: rgba(216,255,152,.58); box-shadow: 0 0 0 4px rgba(216,255,152,.08); }
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  color: #10130d;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-button:disabled { opacity: .62; cursor: not-allowed; }
.link-button { width: 100%; }

.quota-card {
  display: block;
  text-align: center;
}
.bov-single-quota-title {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.68);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}
.bov-single-quota-counter {
  color: var(--green);
  font-size: clamp(58px, 17vw, 96px);
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.07em;
  margin: 4px auto 0;
}
body.bov-quota-zero .bov-single-quota-counter { color: #ffb1b1; }
.bov-single-quota-notice {
  margin: 18px auto 0;
  max-width: 520px;
  padding: 14px 16px;
  border: 1px solid rgba(255,154,154,.45);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,154,154,.13), rgba(255,255,255,.045));
  color: rgba(255,255,255,.82);
  font-size: 15px;
  line-height: 1.35;
}
.bov-single-quota-notice[hidden] { display: none; }
.quota-card p:last-child { margin: 14px 0 0; color: rgba(255,255,255,.78); line-height: 1.35; }

.welcome-card h2, .mode-card h2, .donation-card h2, .install-card h2 { font-size: 19px; margin-bottom: 8px; }
.welcome-card p, .mode-card p, .note-card p, .donation-card p, .install-card p, .page-card p { color: rgba(255,255,255,.75); line-height: 1.45; }
.suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}
.suggestion-grid button, .mode-option, .mobile-menu nav button {
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 18px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}
.mode-options { display: grid; gap: 9px; }
.mode-option.is-selected { border-color: rgba(216,255,152,.7); background: rgba(216,255,152,.12); color: var(--green); }

.accordion-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--green);
  text-align: left;
  font-weight: 900;
  padding: 0;
  cursor: pointer;
}
.privacy-panel { margin-top: 12px; color: rgba(255,255,255,.73); }
.privacy-panel ul { margin: 0; padding-left: 18px; line-height: 1.45; }
.footer { padding: 6px 6px 30px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.45; }

.mobile-menu {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: min(82vw, 310px);
  padding: calc(18px + env(safe-area-inset-top)) 16px 16px;
  background: rgba(8, 11, 18, .96);
  border-right: 1px solid var(--border);
  transform: translateX(-104%);
  transition: transform .22s ease;
  box-shadow: 24px 0 80px rgba(0,0,0,.4);
}
.mobile-menu.is-open { transform: translateX(0); }
.menu-close { margin-left: auto; display: block; font-size: 22px; line-height: 1; }
.mobile-menu nav { display: grid; gap: 10px; margin-top: 24px; }
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  background: rgba(0,0,0,.52);
}
.menu-backdrop.is-open { display: block; }

.chat-shell { height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.chat-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.chat-header h1 { margin: 0; font-size: 18px; }
.chat-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.messages { display: flex; flex-direction: column; gap: 12px; padding-right: 4px; padding-bottom: 4px; overflow-y: auto; min-height: 0; }
.message {
  max-width: 84%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  align-self: flex-end;
  color: #10130d;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  border-color: transparent;
  border-bottom-right-radius: 8px;
}
.message.ai {
  align-self: flex-start;
  background: rgba(255,255,255,.06);
  border-bottom-left-radius: 8px;
}
.message.system { align-self: center; max-width: 92%; color: var(--muted); text-align: center; background: transparent; }
.chat-composer-slot {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(16,20,35,.92), rgba(8,11,18,.86));
  box-shadow: 0 12px 50px rgba(0,0,0,.26);
}
.chat-composer-slot::before {
  content: "Continua pure: il secchio non ti chiede di tornare su per soffrire meglio.";
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.page-card { margin-top: 8px; }
.page-card h1 { font-size: 30px; letter-spacing: -.05em; }
.muted { color: var(--muted); }
.history-list { display: grid; gap: 10px; margin-top: 14px; }
.history-item {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 18px;
  padding: 13px;
  text-align: left;
  cursor: pointer;
}
.history-item strong { display: block; margin-bottom: 4px; color: var(--green); }
.history-item span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }

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

@media (min-width: 761px) {
  body { display: grid; place-items: center; padding: 24px; }
  .mobile-app { display: none; }
  .desktop-gate { display: grid; place-items: center; width: 100%; min-height: 100svh; }
  .desktop-panel {
    width: min(520px, 92vw);
    padding: 36px;
    text-align: center;
    border-radius: 32px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(16,20,35,.92), rgba(8,11,18,.82));
    box-shadow: var(--shadow);
  }
  .app-mark { font-size: 54px; margin-bottom: 12px; }
.image-mark { width: 84px; height: 84px; margin: 0 auto 12px; }
.image-mark img { width: 100%; height: 100%; border-radius: 22px; display: block; }
  .desktop-panel h1 { margin-bottom: 5px; font-size: 46px; letter-spacing: -.07em; }
  .desktop-subtitle, .desktop-note { color: var(--muted); }
  .desktop-url { color: var(--green); font-weight: 900; }
}















/* BOV ROLLING 24H LOCAL QUOTA - rolling-24h-local-quota-20260613-02 */
.quota-reset-text {
  margin-top: 10px !important;
  text-align: center !important;
  color: rgba(255,255,255,.62) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.quota-reset-text[hidden] {
  display: none !important;
}

body.bov-quota-zero #quotaCount,
body.bov-quota-zero .quota-count,
body.bov-quota-zero [data-quota-count] {
  color: #ffb1b1 !important;
}

body.bov-quota-zero .quota-card,
body.bov-quota-zero .quota,
body.bov-quota-zero .quota-box {
  border-color: rgba(255,154,154,.45) !important;
}
/* END BOV ROLLING 24H LOCAL QUOTA */




/* BOV PUBLISH READY FIX - publish-ready-rolling-24h-20260613-01 */
.privacy-extra-note {
  margin: 16px auto 0 !important;
  max-width: 760px !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.045) !important;
  color: rgba(255,255,255,.72) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}
.privacy-extra-note strong {
  color: rgba(255,255,255,.88) !important;
}
/* END BOV PUBLISH READY FIX */




/* BOV FINAL PUBLIC NO NAME - final-public-no-name-20260613-01 */
.donation-legal-note {
  margin: 10px auto 0 !important;
  max-width: 620px !important;
  color: rgba(255,255,255,.62) !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}
/* END BOV FINAL PUBLIC NO NAME */









/* BOV BUY ME A COFFEE VISIBLE FIX - final-buymeacoffee-visible-20260613-02 */
.bmc-support-card {
  text-align: center !important;
}

.bmc-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 12px auto 0 !important;
  padding: 12px 18px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  font-weight: 900 !important;
}

.donation-legal-note {
  margin: 10px auto 0 !important;
  max-width: 620px !important;
  color: rgba(255,255,255,.62) !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}
/* END BOV BUY ME A COFFEE VISIBLE FIX */




/* BOV SIMPLE FOOTER - final-footer-simple-20260613-01 */
.simple-footer {
  margin: 24px auto 0 !important;
  padding: 18px 12px 22px !important;
  text-align: center !important;
  color: rgba(255,255,255,.48) !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
}
/* END BOV SIMPLE FOOTER */




/* BOV BMC BUTTON STYLE - final-bmc-button-20260613-01 */
.bmc-donate-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  min-height: 46px !important;
  padding: 13px 22px !important;
  margin: 14px auto 4px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(216, 255, 152, .55) !important;
  background:
    radial-gradient(circle at 30% 10%, rgba(216,255,152,.24), transparent 34%),
    linear-gradient(180deg, rgba(216,255,152,.18), rgba(126,87,255,.13)) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 14px 34px rgba(0,0,0,.34),
    0 0 26px rgba(216,255,152,.12) !important;
  color: #f4ffd9 !important;
  text-decoration: none !important;
  font-weight: 950 !important;
  font-size: 15px !important;
  letter-spacing: .01em !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

.bmc-donate-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(216, 255, 152, .82) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.07) inset,
    0 18px 42px rgba(0,0,0,.42),
    0 0 34px rgba(216,255,152,.18) !important;
}

.bmc-donate-button:active {
  transform: translateY(0) scale(.99) !important;
}

.bmc-donate-button-icon {
  font-size: 18px !important;
  line-height: 1 !important;
}

.bmc-support-card,
.donation-card,
.donation-box,
.support-card {
  text-align: center !important;
}
/* END BOV BMC BUTTON STYLE */




/* BOV INSTALL BOX CENTERED - final-install-centered-20260613-01 */
.bov-install-centered-box {
  text-align: center !important;
}

.bov-install-centered-box > *,
.bov-install-centered-box h1,
.bov-install-centered-box h2,
.bov-install-centered-box h3,
.bov-install-centered-box p {
  text-align: center !important;
}

.bov-install-centered-box ul,
.bov-install-centered-box ol {
  display: inline-block !important;
  text-align: left !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.bov-install-centered-box a,
.bov-install-centered-box button {
  margin-left: auto !important;
  margin-right: auto !important;
}

.bov-install-title-marker {
  display: block !important;
  text-align: center !important;
}
/* END BOV INSTALL BOX CENTERED */

