/* AgriCompass Demo — a guided, editable example in its own workspace.
   Load after streamlined-ui.css. Normal plans only gain the home launch link;
   active-demo rules never change the normal planning header or input styles. */

/* One recognisable entry point on the normal home screen. */
.app .ac-demo-launch {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 18px;
  max-width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  border: 1px solid var(--ac-brand-forest, #185438);
  border-radius: 10px;
  background: var(--ac-brand-forest, #185438);
  color: #fff;
  box-shadow: 0 2px 5px #18543812;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app .ac-demo-launch > strong {
  grid-column: 1;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.app .ac-demo-launch > span:not([aria-hidden="true"]):not(.ac-demo-launch-arrow) {
  grid-column: 1;
  margin: 0;
  color: #edf4e9;
  font-size: 13px;
  line-height: 1.4;
}
.app .ac-demo-launch > [aria-hidden="true"],
.app .ac-demo-launch > .ac-demo-launch-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}
.app .ac-demo-launch:hover {
  border-color: var(--ac-brand-green, #2d7956);
  background: var(--ac-brand-green, #2d7956);
  color: #fff;
}
.app .ac-demo-launch:focus-visible {
  outline: 3px solid var(--ac-brand-focus, #946400);
  outline-offset: 3px;
}

@media screen {
  .app.ac-demo-active {
    --ac-demo-scroll-clearance: 170px;
    color: var(--ac-brand-ink, #294b3b);
    background: var(--ac-brand-cream, #f6f7f0);
  }

  /* The example has its own small header; normal plan controls stay outside it. */
  .app.ac-demo-active > .ac-demo-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 18px;
    min-height: 72px;
    height: auto;
    padding: 6px 20px;
    border-bottom: 1px solid var(--ac-brand-line, #d5dfd0);
    background: #fff;
    color: var(--ac-brand-forest, #185438);
  }
  .app.ac-demo-active .ac-demo-header .brand {
    flex: 0 0 auto;
    width: 180px;
    max-width: 180px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  .app.ac-demo-active .ac-demo-header .ac-product-mark,
  .app.ac-demo-active .ac-demo-header .brand > img.ac-product-mark {
    display: block;
    width: 180px;
    max-width: 180px;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  .app.ac-demo-active .ac-demo-header-label {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 16px;
    border-left: 1px solid var(--ac-brand-line, #d5dfd0);
    color: var(--ac-brand-forest, #185438);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
  }
  .app.ac-demo-active .ac-demo-header-label small {
    display: block;
    margin: 0;
    color: var(--ac-brand-muted, #607064);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
  }
  .app.ac-demo-active > .app-body { display: block; min-width: 0; }
  .app.ac-demo-active .sidebar { display: none !important; }
  .app.ac-demo-active .ac-demo-workspace,
  .app.ac-demo-active > .app-body > .ac-demo-workspace {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    max-width: 1480px;
    min-width: 0;
    margin: 0 auto;
    padding: 16px 20px 32px;
    background: var(--ac-brand-cream, #f6f7f0);
  }

  /* Keep navigation close at hand without placing an overlay over the form. */
  .app.ac-demo-active .ac-demo-tour {
    position: sticky;
    z-index: 40;
    top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px 12px;
    width: 100%;
    min-width: 0;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #c2d2bd;
    border-left: 4px solid var(--ac-brand-green, #2d7956);
    border-radius: 9px;
    background: #f4f8ef;
    color: var(--ac-brand-ink, #294b3b);
    box-shadow: 0 3px 10px #1854380c;
    font-family: inherit;
  }
  .app.ac-demo-active .ac-demo-step-copy { grid-column: 1; min-width: 0; }
  .app.ac-demo-active .ac-demo-tour .ac-demo-progress {
    margin: 0 0 3px;
    color: #516448;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-step-title {
    margin: 0;
    padding: 0;
    color: var(--ac-brand-forest, #185438);
    font-size: 17px !important;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-step-task {
    margin: 4px 0 0;
    color: var(--ac-brand-ink, #294b3b);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .app.ac-demo-active .ac-demo-controls {
    grid-column: 2;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(button, a) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 62px;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #a7baa0;
    border-radius: 7px;
    background: #fff;
    color: var(--ac-brand-forest, #185438);
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(button, a):hover {
    border-color: var(--ac-brand-green, #2d7956);
    background: var(--ac-brand-sage, #e3ecdf);
    color: var(--ac-brand-forest, #185438);
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(.primary, .ac-demo-next) {
    border-color: var(--ac-brand-green, #2d7956);
    background: var(--ac-brand-green, #2d7956);
    color: #fff;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(.primary, .ac-demo-next):hover {
    border-color: var(--ac-brand-forest, #185438);
    background: var(--ac-brand-forest, #185438);
    color: #fff;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(button, a):is(:disabled, [aria-disabled="true"]),
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(button, a):is(:disabled, [aria-disabled="true"]):hover {
    border-color: #c4cfc0;
    background: #edf1e8;
    color: #596951;
    opacity: 1;
    cursor: not-allowed;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-controls .ac-demo-exit { min-width: 86px; }

  .app.ac-demo-active .ac-demo-jump { grid-column: 3; min-width: 0; margin: 0; }
  .app.ac-demo-active .ac-demo-jump > summary {
    list-style-position: inside;
    min-height: 44px;
    padding: 10px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--ac-brand-forest, #185438);
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 22px;
    white-space: nowrap;
    cursor: pointer;
  }
  .app.ac-demo-active .ac-demo-jump > summary:hover,
  .app.ac-demo-active .ac-demo-jump[open] > summary {
    border-color: var(--ac-brand-line, #d5dfd0);
    background: var(--ac-brand-sage, #e3ecdf);
  }
  .app.ac-demo-active .ac-demo-jump[open] { grid-column: 1 / -1; }
  .app.ac-demo-active .ac-demo-jump[open] > summary { width: fit-content; }
  .app.ac-demo-active .ac-demo-jump label {
    display: grid;
    gap: 5px;
    width: 100%;
    max-width: 560px;
    margin: 8px 0 0;
    color: var(--ac-brand-ink, #294b3b);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
  }
  .app.ac-demo-active .ac-demo-jump select {
    display: block;
    width: 100%;
    max-width: 560px;
    min-width: 0;
    min-height: 44px;
    margin: 4px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--ac-brand-field, #85977f);
    border-radius: 7px;
    background: #fff;
    color: var(--ac-brand-ink, #294b3b);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-safety {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 7px;
    border-top: 1px solid #dbe5d3;
    color: #516448;
    font-size: 12px;
    line-height: 1.4;
  }
  .app.ac-demo-active .ac-demo-tour:has(.ac-demo-jump[open]) { position: relative; top: auto; }

  .app.ac-demo-active .ac-demo-tour :is(button, a, select, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--ac-brand-focus, #946400);
    outline-offset: 3px;
  }
  .app.ac-demo-active .ac-demo-workspace :is(h1, h2, h3, input, select, textarea, button, summary, [tabindex]) {
    scroll-margin-block-start: var(--ac-demo-scroll-clearance);
  }
  .app.ac-demo-active .ac-demo-tour .ac-demo-step-title { scroll-margin-block-start: 14px; }
  .app.ac-demo-active .ac-demo-frame-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--ac-brand-line, #d5dfd0);
    border-radius: 9px;
    background: #fff;
  }
  .app.ac-demo-active iframe.ac-demo-frame {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 320px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    scroll-margin-block-start: var(--ac-demo-scroll-clearance);
  }

  @media (max-width: 1000px) {
    .app.ac-demo-active { --ac-demo-scroll-clearance: 220px; }
    .app.ac-demo-active .ac-demo-tour {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 9px 10px;
    }
    .app.ac-demo-active .ac-demo-step-copy { grid-column: 1 / -1; }
    .app.ac-demo-active .ac-demo-controls { grid-column: 1; }
    .app.ac-demo-active .ac-demo-jump { grid-column: 2; justify-self: end; }
    .app.ac-demo-active .ac-demo-jump[open] { grid-column: 1 / -1; justify-self: stretch; }
  }
  @media (max-width: 650px) {
    .app .ac-demo-launch { width: 100%; min-height: 72px; padding: 13px 15px; }
    .app.ac-demo-active > .ac-demo-header {
      flex-wrap: nowrap;
      gap: 12px;
      min-height: 64px;
      padding: 6px 12px;
    }
    .app.ac-demo-active .ac-demo-header .brand,
    .app.ac-demo-active .ac-demo-header .ac-product-mark,
    .app.ac-demo-active .ac-demo-header .brand > img.ac-product-mark { width: 150px; max-width: 150px; }
    .app.ac-demo-active .ac-demo-header-label { padding-left: 12px; font-size: 13px; }
    .app.ac-demo-active .ac-demo-header-label small { font-size: 11px; }
    .app.ac-demo-active .ac-demo-workspace,
    .app.ac-demo-active > .app-body > .ac-demo-workspace { padding: 10px 10px 24px; }
    .app.ac-demo-active .ac-demo-tour {
      top: 0;
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
      margin-bottom: 10px;
      padding: 10px;
      border-left-width: 3px;
      border-radius: 8px;
    }
    .app.ac-demo-active .ac-demo-tour .ac-demo-progress { margin-bottom: 2px; padding-right: 123px; font-size: 11px; }
    .app.ac-demo-active .ac-demo-tour .ac-demo-step-title { min-height: 26px; padding-right: 123px; font-size: 16px !important; line-height: 1.25; }
    .app.ac-demo-active .ac-demo-tour .ac-demo-step-task { margin-top: 4px; font-size: 13px; line-height: 1.4; }
    .app.ac-demo-active .ac-demo-controls {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(44px, .8fr) minmax(44px, .8fr) minmax(76px, 1fr);
      gap: 5px;
    }
    .app.ac-demo-active .ac-demo-tour .ac-demo-controls :is(button, a) {
      width: 100%;
      min-width: 0;
      min-height: 44px;
      padding: 8px 7px;
      font-size: 12px;
      line-height: 1.3;
      white-space: normal;
    }
    .app.ac-demo-active .ac-demo-tour .ac-demo-controls .ac-demo-exit { min-width: 76px; }
    /* The chooser is nested in the controls in the live DOM. When closed,
       place it beside the heading, keeping all three navigation controls on one row. */
    .app.ac-demo-active .ac-demo-jump:not([open]) {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 115px;
      max-width: 115px;
      margin: 0;
    }
    .app.ac-demo-active .ac-demo-jump > summary { padding: 10px 7px; font-size: 11px; }
    .app.ac-demo-active .ac-demo-jump[open] {
      position: static;
      grid-column: 1 / -1;
      justify-self: stretch;
      width: 100%;
      max-width: none;
    }
    .app.ac-demo-active .ac-demo-jump select { font-size: 16px; }
    .app.ac-demo-active .ac-demo-tour:has(.ac-demo-jump[open]) :is(.ac-demo-progress, .ac-demo-step-title) { padding-right: 0; }
    .app.ac-demo-active .ac-demo-tour:has(.ac-demo-safety),
    .app.ac-demo-active .ac-demo-tour:has(.ac-demo-exploring) { position: relative; top: auto; }
    .app.ac-demo-active .ac-demo-tour .ac-demo-safety { padding-top: 6px; font-size: 11px; }
    .app.ac-demo-active iframe.ac-demo-frame { min-height: 280px; }
  }
  @media (max-width: 360px) {
    .app.ac-demo-active .ac-demo-header .brand,
    .app.ac-demo-active .ac-demo-header .ac-product-mark,
    .app.ac-demo-active .ac-demo-header .brand > img.ac-product-mark { width: 132px; max-width: 132px; }
    .app.ac-demo-active .ac-demo-header-label { font-size: 12px; }
    .app.ac-demo-active .ac-demo-controls { grid-column: 1 / -1; }
    .app.ac-demo-active .ac-demo-jump { grid-column: 1 / -1; justify-self: start; }
    .app.ac-demo-active .ac-demo-jump > summary { padding-inline: 8px; }
    .app.ac-demo-active .ac-demo-tour { position: relative; top: auto; }
  }
  @media (max-height: 600px) {
    /* A small viewport or open phone keyboard needs room for the actual inputs. */
    .app.ac-demo-active .ac-demo-tour { position: relative; top: auto; }
    .app.ac-demo-active { --ac-demo-scroll-clearance: 16px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .app .ac-demo-launch,
    .app.ac-demo-active .ac-demo-tour :is(button, a, select, summary) { transition: none; animation: none; }
  }
}

@media print {
  .app .ac-demo-launch,
  .app.ac-demo-active .ac-demo-tour { display: none !important; }
  .app.ac-demo-active .ac-demo-workspace,
  .app.ac-demo-active > .app-body > .ac-demo-workspace { width: 100%; max-width: none; padding: 0; }
  .app.ac-demo-active .ac-demo-frame-wrap,
  .app.ac-demo-active iframe.ac-demo-frame { border: 0; border-radius: 0; box-shadow: none; }
}
