:root {
  color-scheme: light;
  --bg: #f8faf7;
  --surface: #fffdf7;
  --surface-soft: #eef5ef;
  --text: #24312c;
  --muted: #64726b;
  --border: #d9e3dc;
  --accent: #477763;
  --accent-dark: #315d4b;
  --focus: #f2bc57;
  --shadow: 0 20px 60px rgba(43, 70, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.billing-message {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 24px), 520px);
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--accent-dark);
  padding: 14px 18px;
  text-align: center;
  font-weight: 800;
}

.billing-message[data-type="cancelled"] {
  color: var(--muted);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 18px 12px 44px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 22px;
  width: min(100%, 1060px);
  margin: 18px auto 0;
  padding: 8px 12px 26px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.site-footer a {
  color: var(--accent-dark);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.app-footer {
  margin-top: 18px;
}

.legal-shell {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 18px 12px 52px;
}

.legal-header,
.legal-content {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(38, 57, 49, 0.08);
}

.legal-header {
  padding: clamp(24px, 5vw, 42px);
  margin-bottom: 18px;
}

.legal-header .brand-name {
  display: inline-block;
  margin-bottom: 24px;
  text-decoration: none;
}

.legal-header .brand-name:hover {
  text-decoration: none;
}

.legal-header h1 {
  max-width: 760px;
  margin: 0;
  color: var(--accent-dark);
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.legal-header p {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
}

.legal-content {
  padding: clamp(22px, 4vw, 34px);
}

.legal-content section + section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.legal-content h2 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.15;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 0.98rem;
}

.legal-content a {
  color: var(--accent-dark);
  font-weight: 800;
}

.legal-content ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.legal-note {
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 18px;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.legal-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 18px;
  background: #ffffff;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 900;
}

.legal-actions a:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.hero {
  position: relative;
  display: grid;
  gap: 24px;
  min-height: auto;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #e3e9e3;
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 18px 48px rgba(38, 57, 49, 0.12);
  padding: 24px 20px;
}

.hero::before {
  position: absolute;
  inset: auto -120px -180px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(225, 238, 221, 0.72);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.site-menu {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-email {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(245, 247, 245, 0.82);
  color: var(--muted);
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.navs-left {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(245, 247, 245, 0.82);
  color: var(--muted);
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: default;
}

.site-menu > button,
.menu-panel button,
.modal-header button,
.history-toolbar button,
.plan-options button,
#cancel-subscription {
  min-height: 40px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-dark);
  padding: 0 14px;
  font-size: 0.95rem;
}

#menu-toggle {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(49, 93, 75, 0.18);
}

.site-menu > button:hover,
.menu-panel button:hover,
.modal-header button:hover,
.history-toolbar button:hover,
.plan-options button:hover,
#cancel-subscription:hover {
  background: var(--surface-soft);
}

#menu-toggle:hover {
  background: var(--accent-dark);
}

.menu-panel {
  position: absolute;
  top: 48px;
  right: 0;
  display: grid;
  min-width: 150px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.menu-panel:not(.hidden) {
  display: grid !important;
}

.menu-panel button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 719px) {
  .site-menu {
    top: 14px;
    right: 14px;
    left: 14px;
    display: grid;
    grid-template-columns: max-content max-content;
    justify-content: end;
    gap: 8px;
  }

  .navs-left,
  .site-menu > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    text-align: center;
    font-size: 0.9rem;
  }

  .navs-left {
    min-width: 138px;
  }

  #menu-toggle {
    min-width: 86px;
  }

  .user-email {
    display: none;
  }

  .navs-left {
    grid-column: auto;
  }

  .site-menu:has(.navs-left.hidden) .navs-left {
    display: none;
  }

  .site-menu:has(.navs-left.hidden) {
    grid-template-columns: max-content;
  }

  .site-menu:has(.navs-left.hidden) #menu-toggle {
    grid-column: 1;
  }

  .site-menu .menu-panel {
    top: 52px;
  }

  #app-shell .brand-mark {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 3;
    margin: 0;
  }

  #app-shell .hero-content {
    position: static;
  }

  #app-shell .hero {
    padding-top: 96px;
  }
}

.brand-mark,
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  font-size: 0.96rem;
}

.brand-name {
  color: #173f39;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.auth-hero {
  margin-bottom: 18px;
}

.auth-card {
  max-width: 620px;
  width: min(100%, 620px);
  max-height: min(88vh, 760px);
  overflow: auto;
  margin: 0 auto;
  padding: 28px 20px;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(20, 35, 30, 0.34);
  padding: 18px;
}

.auth-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.auth-dialog-header h2 {
  margin: 0;
  color: #173f39;
  font-size: 1.25rem;
}

.auth-dialog-header button {
  min-height: 40px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-dark);
  padding: 0 14px;
  font-size: 0.95rem;
}

.auth-dialog-header button:hover {
  background: var(--surface-soft);
}

.auth-mobile-menu {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
}

.auth-mobile-menu > button {
  min-height: 40px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 0 14px;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(49, 93, 75, 0.18);
}

.auth-mobile-menu > button:hover {
  background: var(--accent-dark);
}

.auth-mobile-menu-panel {
  position: absolute;
  top: 48px;
  right: 0;
  display: grid;
  min-width: 150px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.auth-mobile-menu-panel button {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-dark);
  padding: 0 14px;
  text-align: center;
  font-size: 0.95rem;
}

.auth-mobile-menu-panel button:hover {
  background: var(--surface-soft);
}

.auth-top-actions {
  width: min(100%, 420px);
  margin: -4px auto 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.auth-top-actions-desktop {
  display: none;
}

.auth-top-actions button {
  min-height: 46px;
  padding: 0 22px;
  font-size: 0.95rem;
}

.auth-top-actions .primary {
  width: 100%;
}

.auth-top-actions button {
  width: 100%;
}

.short-label {
  display: inline;
}

.full-label {
  display: none;
}

.auth-top-actions button:not(.primary) {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-dark);
}

.auth-top-actions button:not(.primary):hover {
  background: var(--surface-soft);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 6px;
}

.auth-tabs button {
  min-height: 44px;
  background: transparent;
  color: var(--accent-dark);
}

.auth-tabs button.is-active {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(43, 70, 58, 0.1);
}

.auth-card.is-checkout-ready .auth-tabs {
  display: none;
}

.auth-card.is-checkout-ready .auth-dialog-header {
  justify-content: flex-end;
}

.auth-card.is-checkout-ready .auth-dialog-header h2 {
  display: none;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.checkout-ready {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.checkout-ready h3 {
  margin: 0;
  color: #173f39;
  font-size: 1.55rem;
}

.checkout-ready p {
  margin: 0;
  color: var(--muted);
}

.billing-return-card {
  max-width: 540px;
}

.auth-message {
  margin: 0;
  border-radius: 14px;
  background: #fff3ec;
  color: #8a3d2c;
  padding: 12px 14px;
  font-weight: 700;
  white-space: pre-line;
}

.auth-message[data-type="success"] {
  background: var(--surface-soft);
  color: var(--accent-dark);
}

.auth-link {
  width: fit-content;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-dark);
  padding: 10px 16px;
  font-size: 0.95rem;
}

.auth-link:hover {
  background: var(--surface-soft);
}

.about-navvly {
  display: grid;
  gap: 28px;
  margin: 18px 0 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 16px 44px rgba(43, 70, 58, 0.08);
  padding: 28px 20px;
}

.about-heading h2 {
  margin: 0;
  color: #3f876d;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.75rem, 6.5vw, 2.45rem);
  font-weight: 900;
  line-height: 1.08;
  max-width: 620px;
}

.about-body {
  display: grid;
  gap: 14px;
  color: #30443d;
  font-size: 1.02rem;
}

.about-body p {
  margin: 0;
}

.about-support {
  margin-top: 6px !important;
  border-left: 3px solid var(--accent);
  color: #173f39;
  padding-left: 14px;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.25;
}

.pricing-section {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 16px 44px rgba(43, 70, 58, 0.08);
  padding: 22px 18px;
}

.pricing-inner {
  display: grid;
  gap: 18px;
}

.about-navvly:not(.is-mobile-revealed),
.pricing-section:not(.is-mobile-revealed) {
  display: none;
}

.pricing-header {
  max-width: 760px;
}

.pricing-header h2 {
  margin: 0;
  color: #3f876d;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.75rem, 6.5vw, 2.45rem);
  font-weight: 900;
  line-height: 1.08;
}

.pricing-header > p:last-child {
  margin: 12px 0 0;
  color: #30443d;
}

.pricing-grid {
  display: grid;
  gap: 14px;
}

.pricing-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 16px 44px rgba(43, 70, 58, 0.08);
  padding: 22px 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pricing-card:hover {
  border-color: #b5cbc0;
  box-shadow: 0 20px 54px rgba(43, 70, 58, 0.12);
  transform: translateY(-2px);
}

.pricing-card-featured {
  border-color: rgba(71, 119, 99, 0.5);
  background: linear-gradient(180deg, #fffdf7 0%, #f3f8f2 100%);
}

.plan-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-topline h3 {
  margin: 0;
  color: #173f39;
  font-size: 1.35rem;
}

.plan-topline span {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.plan-price {
  margin: 0;
  color: #173f39;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 2.55rem;
  font-weight: 900;
  line-height: 1;
}

.plan-price span {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.pricing-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  position: relative;
  padding-left: 26px;
  color: #30443d;
}

.pricing-card li::before {
  position: absolute;
  top: 0.18rem;
  left: 0;
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  content: "✓";
}

.pricing-button {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0 20px;
  font-size: 1rem;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pricing-button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.pricing-button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.pricing-button-primary:hover {
  background: var(--accent-dark);
}

.usage-explainer {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.usage-explainer h3 {
  margin: 0;
  color: #173f39;
  font-size: 1.15rem;
}

.usage-explainer p {
  margin: 0 0 8px;
  color: var(--muted);
}

.usage-explainer p:last-child {
  margin-bottom: 0;
}

h1,
h2,
legend,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: #173f39;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.4rem, 11.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: 0;
}

h1 span {
  color: #3f876d;
}

.intro-copy {
  max-width: 520px;
  margin: 16px 0 0;
  color: #30443d;
  font-size: 1rem;
}

.hero-benefits {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #31433e;
  font-size: 0.96rem;
  font-weight: 700;
}

.benefit-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #edf5e8;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.desktop-line-break {
  display: none;
}

.hero-visual {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: none;
  width: 300px;
  height: 260px;
}

.chat-bubble {
  position: absolute;
  top: 32px;
  right: 24px;
  width: 190px;
  height: 92px;
  border-radius: 42px;
  background: #e9f1df;
  opacity: 0.85;
}

.chat-bubble::before,
.chat-bubble::after {
  position: absolute;
  left: 42px;
  right: 42px;
  height: 7px;
  border-radius: 999px;
  background: #d8e3d1;
  content: "";
}

.chat-bubble::before {
  top: 31px;
}

.chat-bubble::after {
  top: 51px;
}

.answer-card {
  position: absolute;
  right: 4px;
  bottom: 6px;
  display: flex;
  width: 250px;
  min-height: 94px;
  align-items: center;
  gap: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(63, 92, 76, 0.12);
  padding: 18px;
}

.answer-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #9bc878;
}

.answer-card span::before {
  width: 16px;
  height: 9px;
  border-bottom: 4px solid #ffffff;
  border-left: 4px solid #ffffff;
  transform: rotate(-45deg);
  content: "";
}

.answer-card div {
  display: grid;
  flex: 1;
  gap: 9px;
}

.answer-card i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e5ebe4;
}

.answer-card i:nth-child(2) {
  width: 80%;
}

.answer-card i:nth-child(3) {
  width: 62%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.plan-gate {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 28px 20px;
  text-align: center;
}

.plan-gate h2 {
  margin: 0;
  color: #173f39;
  font-size: clamp(1.65rem, 4vw, 2.3rem);
}

.plan-gate p {
  width: min(100%, 620px);
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.04rem;
}

.plan-gate .primary {
  width: min(100%, 420px);
  margin: 6px auto 0;
}

form.card {
  position: relative;
  padding: 4px;
}

form.card.is-locked,
form.card.is-limit-reached {
  background: #f1f2f1;
}

form.card.is-locked .section,
form.card.is-locked .cta-row,
form.card.is-limit-reached .section,
form.card.is-limit-reached .cta-row {
  opacity: 0.58;
}

form.card.is-locked .choice,
form.card.is-locked .field input,
form.card.is-locked .field textarea,
form.card.is-locked .upload-card,
form.card.is-locked .primary,
form.card.is-limit-reached .choice,
form.card.is-limit-reached .field input,
form.card.is-limit-reached .field textarea,
form.card.is-limit-reached .upload-card,
form.card.is-limit-reached .cta-row .primary {
  cursor: not-allowed;
}

.nav-limit-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-items: start;
  justify-items: center;
  background: rgba(241, 242, 241, 0.72);
  padding: 28px 18px;
}

.nav-limit-card {
  display: grid;
  gap: 14px;
  width: min(100%, 620px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}

.nav-limit-card h2 {
  margin: 0;
  color: #173f39;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.nav-limit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.nav-limit-card .primary {
  width: min(100%, 340px);
  margin: 4px auto 0;
}

@media (max-width: 719px) {
  .nav-limit-overlay {
    padding: 24px 14px;
  }

  .nav-limit-card {
    width: min(100%, 330px);
    justify-self: center;
    padding: 24px 22px;
  }

  .nav-limit-card .primary {
    width: 100%;
  }
}

.section {
  padding: 22px 16px;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: 0;
}

.section h2,
.results h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.optional-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.optional-section:not(.is-collapsed) {
  margin: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0;
}

.optional-section:not(.is-collapsed) + .optional-section:not(.is-collapsed) {
  margin-top: 0;
}

.optional-section-toggle {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 10px 16px;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.2;
}

.optional-section:not(.is-collapsed) .optional-section-toggle {
  border-width: 0 0 1px;
  border-radius: 18px 18px 0 0;
  background: transparent;
}

.optional-section-toggle > span:first-child {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.optional-section-toggle:hover {
  background: #ffffff;
}

.optional-toggle-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 1.25rem;
  line-height: 1;
}

.optional-section-content {
  padding: 12px 16px 16px;
}

.optional-section-content legend {
  padding-top: 4px;
  margin-bottom: 12px;
}

.optional-section.is-collapsed .optional-section-content {
  display: none;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice:hover {
  border-color: #aac4b7;
  transform: translateY(-1px);
}

.choice input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--text);
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 36px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--accent-dark);
  padding: 0 12px;
  font-size: 0.86rem;
}

.password-toggle:hover {
  background: #ffffff;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.helper-text {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.error-text {
  color: #a33d35;
  font-size: 0.95rem;
  font-weight: 700;
}

.field textarea[aria-invalid="true"],
.field input[aria-invalid="true"] {
  border-color: #a33d35;
}

.upload-card {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px dashed #a9beb4;
  border-radius: 18px;
  background: #fbfdfb;
  padding: 16px;
}

.upload-button {
  display: inline-flex;
  min-height: 46px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 800;
}

.support-text {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
}

.upload-field input[type="file"] {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.field input:focus,
.field textarea:focus,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.dynamic-stack {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.file-list {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.95rem;
}

.file-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.cta-row {
  display: grid;
  gap: 14px;
  padding: 20px 16px 22px;
}

.cta-row p {
  margin: 0;
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  min-height: 56px;
  width: 100%;
  background: var(--accent);
  color: #ffffff;
  padding: 0 28px;
  font-size: 1.08rem;
}

.primary:hover {
  background: var(--accent-dark);
}

.primary[disabled] {
  cursor: wait;
  opacity: 0.75;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: loading-dot-pulse 900ms ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.loading-dots span:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes loading-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.results {
  margin-top: 24px;
  padding: 24px 18px;
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.answer-header .eyebrow {
  margin-bottom: 0;
}

.answer-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
}

.answer-box-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.answer-box-actions button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-dark);
}

.answer-box-actions button:hover {
  background: var(--surface-soft);
}

.answer-box-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.answer-box-actions svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.answer-output {
  padding: 0 6px 6px;
  color: #1f2a26;
  font-size: 1.05rem;
}

.answer-output > :first-child {
  margin-top: 0;
}

.answer-output > :last-child {
  margin-bottom: 0;
}

.answer-output p {
  margin: 0 0 1rem;
}

.answer-output ul,
.answer-output ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.answer-output li + li {
  margin-top: 0.35rem;
}

.answer-output table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.98rem;
}

.answer-output th,
.answer-output td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.answer-output th {
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.answer-output code {
  border-radius: 6px;
  background: #eef2ef;
  padding: 0.1rem 0.3rem;
  font-size: 0.95em;
}

.copy-action {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 22px 0 14px;
}

.copy-action button {
  min-height: 52px;
  width: 100%;
  padding: 0 22px;
  font-size: 1rem;
}

.copy-status {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(43, 70, 58, 0.12);
  color: var(--accent-dark);
  padding: 6px 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}

#copy-answer {
  background: var(--accent);
  color: #ffffff;
}

#copy-answer:hover {
  background: var(--accent-dark);
}

#start-again {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-dark);
}

#start-again:hover {
  background: var(--surface-soft);
}

.answer-update {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
}

.answer-update .field {
  margin-top: 0;
}

.answer-update-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.answer-update-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.answer-update-footer .update-message {
  width: 100%;
  color: #7a4b23;
}

.answer-update-actions {
  display: flex;
  gap: 8px;
}

.answer-update-actions button {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 1.3rem;
  line-height: 1;
}

.answer-update-actions button:hover {
  background: var(--surface-soft);
}

#submit-update {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

#submit-update:hover {
  background: var(--accent-dark);
}

.answer-update-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

pre {
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  border-radius: 16px;
  background: #f3f7f4;
  color: #26342e;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(20, 35, 30, 0.34);
  padding: 18px;
}

.modal-card {
  width: min(100%, 760px);
  max-height: min(86vh, 780px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(20, 35, 30, 0.22);
  padding: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.modal-body {
  padding-top: 18px;
}

.modal-editorial {
  display: grid;
  gap: 12px;
}

.modal-editorial h3 {
  margin: 0;
  color: #173f39;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.55rem, 6vw, 2.25rem);
  line-height: 1.08;
}

.modal-editorial p {
  margin: 0;
  color: #30443d;
}

.modal-pricing-grid {
  margin: 18px 0;
}

#pricing-panel .pricing-card {
  padding: 22px 18px;
}

#pricing-panel .plan-price {
  font-size: 2.2rem;
}

.history-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.history-toolbar p {
  margin: 0;
  color: var(--muted);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-empty,
.history-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfdfb;
  padding: 14px;
}

.history-empty {
  color: var(--muted);
}

.history-item h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1rem;
}

.history-item time {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-item details {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}

.history-item pre {
  max-height: 220px;
  font-size: 0.88rem;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfdfb;
  padding: 18px;
}

.plan-card h3 {
  margin: 0;
  font-size: 1.7rem;
}

.plan-card p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.account-email-card h3 {
  overflow: hidden;
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-options {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.plan-options button.is-selected {
  border-color: var(--accent);
  background: var(--surface-soft);
}

#cancel-subscription {
  color: #8a3a34;
}

@media (min-width: 720px) {
  .shell {
    padding: 54px 28px 80px;
  }

  .hero {
    min-height: 480px;
    padding: 42px 44px 34px;
  }

  .auth-mobile-menu {
    display: none;
  }

  .about-navvly,
  .pricing-section {
    display: grid !important;
  }

  .brand-mark {
    margin-bottom: 42px;
  }

  h1 {
    font-size: clamp(3.6rem, 6.7vw, 4.65rem);
  }

  .intro-copy {
    font-size: 1.12rem;
  }

  .about-navvly {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
    gap: 42px;
    padding: 42px;
  }

  .pricing-section {
    padding: 34px;
  }

  .pricing-header {
    max-width: none;
  }

  .pricing-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    white-space: nowrap;
  }

  .pricing-inner {
    gap: 22px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .pricing-card {
    padding: 28px;
  }

  .usage-explainer {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.4fr);
    padding: 24px 28px;
  }

  form.card {
    padding: 8px;
  }

  .section,
  .results {
    padding: 30px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cta-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 24px 30px 28px;
  }

  .primary {
    width: auto;
  }

  .auth-top-actions {
    grid-template-columns: auto auto;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
  }

  .auth-top-actions-mobile {
    display: none;
  }

  .auth-top-actions-desktop {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: grid;
  }

  .auth-top-actions .primary {
    width: auto;
  }

  .auth-top-actions button {
    width: auto;
  }

  .short-label {
    display: none;
  }

  .full-label {
    display: inline;
  }

  .copy-action button {
    width: auto;
  }

  .copy-action {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  .history-toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .history-actions {
    justify-content: end;
  }

  .plan-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 940px) {
  .hero-benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 720px;
  }

  .desktop-line-break {
    display: inline;
  }

  .benefit {
    border-right: 1px solid var(--border);
    padding-right: 14px;
  }

  .benefit:last-child {
    border-right: 0;
  }

  .hero-visual {
    display: block;
  }
}
