/* Final application geometry. Keep this file last so legacy experiments cannot
   reserve a hidden sidebar column or constrain the working area. */
.huntly-app-v2 {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.huntly-app-v2 .huntly-sidebar {
  width: 224px;
  min-width: 224px;
}

.huntly-app-v2 .app-main {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
}

.huntly-app-v2 .huntly-page {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.huntly-app-v2 .huntly-panel,
.huntly-app-v2 .huntly-overview-v5,
.huntly-app-v2 .huntly-settings-v2,
.huntly-app-v2 .huntly-download-panel,
.huntly-app-v2 .huntly-billing-panel {
  box-sizing: border-box;
  width: min(100%, 1180px);
  max-width: 1180px;
  margin-inline: auto;
}

@media (max-width: 1000px) {
  .huntly-app-v2 {
    display: block;
  }

  .huntly-app-v2 .huntly-sidebar {
    position: sticky;
    top: 64px;
    z-index: 19;
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid #e4e9e7;
  }

  .huntly-app-v2 .huntly-sidebar > .brand,
  .huntly-app-v2 .huntly-sidebar-bottom,
  .huntly-app-v2 .huntly-nav-label {
    display: none;
  }

  .huntly-app-v2 .huntly-sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .huntly-app-v2 .huntly-sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .huntly-app-v2 .huntly-sidebar nav button {
    width: auto;
    min-width: max-content;
    height: 40px;
    min-height: 40px;
    padding-inline: 13px;
  }

  .huntly-app-v2 .app-main {
    display: block;
    width: 100%;
  }

  .huntly-app-v2 .huntly-page {
    width: 100%;
    padding: 24px;
  }
}

@media (max-width: 620px) {
  .huntly-app-v2 .topbar {
    padding-inline: 16px;
  }

  .huntly-app-v2 .huntly-page {
    padding: 20px 16px 32px;
  }
}

/* v4 — responsive controls stay tappable and do not block page scrolling. */
@media (max-width: 1000px) {
  .huntly-app-v2 { touch-action: manipulation; }
  .huntly-app-v2 .huntly-sidebar { position: sticky !important; transform: none !important; transition: none !important; box-shadow: none !important; }
  .huntly-app-v2 .huntly-sidebar nav { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
  .huntly-app-v2 .huntly-sidebar nav button,
  .huntly-app-v2 button,
  .huntly-app-v2 a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .huntly-app-v2 .huntly-sidebar nav button { min-height: 44px; }
}

@media (max-width: 620px) {
  .huntly-app-v2 .topbar { position: relative; z-index: 21; }
  .huntly-app-v2 .huntly-page { padding-top: 16px; }
}

/* Simple settings: essentials first, optional controls behind one disclosure. */
.huntly-settings-simple {
  display: grid;
  gap: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.huntly-settings-simple > .huntly-settings-group,
.huntly-advanced-settings {
  overflow: visible;
  border: 1px solid #dfe7e3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgb(31 70 54 / 4%);
}

.huntly-settings-simple > .huntly-settings-group {
  border-bottom: 1px solid #dfe7e3;
}

.huntly-required-badge,
.huntly-new-badge {
  display: inline-flex;
  width: max-content;
  margin-bottom: 9px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #e9f8f1;
  color: #078f49;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
}

.huntly-new-badge {
  background: #edf4ff;
  color: #3467aa;
}

.huntly-schedule-group {
  background: linear-gradient(115deg, #fff 0%, #f4fbf7 100%) !important;
}

.huntly-advanced-settings > summary {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
}

.huntly-advanced-settings > summary::-webkit-details-marker { display: none; }
.huntly-advanced-settings > summary > span { display: grid; gap: 4px; }
.huntly-advanced-settings > summary strong { color: #121b18; font-size: 16px; }
.huntly-advanced-settings > summary small { color: #7b8781; font-size: 12px; }
.huntly-advanced-settings > summary > i {
  width: 10px;
  height: 10px;
  border-right: 2px solid #52615a;
  border-bottom: 2px solid #52615a;
  transform: rotate(45deg) translateY(-3px);
  transition: transform .18s ease;
}
.huntly-advanced-settings[open] > summary > i { transform: rotate(225deg) translate(-2px, -1px); }
.huntly-advanced-settings[open] > summary { border-bottom: 1px solid #e8ecea; }
.huntly-advanced-body { display: grid; gap: 0; }
.huntly-advanced-body .huntly-settings-group { border-bottom: 1px solid #e8ecea; }
.huntly-advanced-body .huntly-settings-group:last-child { border-bottom: 0; }
.huntly-settings-simple > .huntly-settings-save {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  border: 1px solid #dfe7e3;
  border-radius: 14px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 12px 34px rgb(22 54 42 / 10%);
  backdrop-filter: blur(12px);
}

@media (max-width: 700px) {
  .huntly-advanced-settings > summary { padding: 16px 18px; }
}

/* Geometry corrections after adding schedule and the fourth summary row. */
.huntly-home-grid {
  grid-auto-rows: auto;
}

.huntly-home-grid > .huntly-home-card,
.huntly-home-grid > .huntly-current-settings,
.huntly-home-grid > .huntly-recent-runs {
  height: auto;
  min-height: 238px;
}

.huntly-current-settings dl {
  height: auto;
}

.huntly-current-settings dl > div {
  height: auto;
  min-height: 48px;
}

.huntly-settings-simple > .huntly-settings-group {
  padding: 28px 30px 30px;
}

.huntly-settings-simple > .huntly-settings-group > header {
  margin-bottom: 24px;
}

.huntly-settings-simple > .huntly-settings-group > .huntly-settings-fields {
  width: 100%;
  gap: 22px 28px;
}

.huntly-settings-simple .huntly-setting-range.is-salary {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.huntly-settings-simple .huntly-setting-range.is-salary > div {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 14px;
}

.huntly-settings-simple .huntly-setting-range.is-salary input {
  width: 100%;
}

@media (max-width: 700px) {
  .huntly-home-grid > .huntly-home-card,
  .huntly-home-grid > .huntly-current-settings,
  .huntly-home-grid > .huntly-recent-runs {
    min-height: 0;
  }

  .huntly-settings-simple > .huntly-settings-group {
    padding: 22px 18px 24px;
  }
}

/* Run history is a compact status list, not vertically centered empty state. */
.huntly-home-grid {
  align-items: stretch;
  grid-auto-rows: auto;
}

.huntly-home-grid > .huntly-recent-runs,
.huntly-home-grid > .huntly-current-settings {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
}

.huntly-recent-runs .huntly-empty-runs {
  display: flex;
  height: auto;
  min-height: 76px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid #e4ebe7;
  border-radius: 13px;
  padding: 14px 16px;
  background: #f8faf9;
}

.huntly-recent-runs .huntly-empty-runs > span {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #eaf7f1;
}

.huntly-recent-runs .huntly-empty-runs > div {
  gap: 4px;
}

.huntly-recent-runs .huntly-empty-runs strong {
  font-size: 14px;
  line-height: 1.35;
}

.huntly-recent-runs .huntly-empty-runs small {
  font-size: 11px;
  line-height: 1.45;
}

.huntly-live-run {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid #cfe8de;
  border-radius: 13px;
  padding: 15px 16px;
  background: #f2faf6;
}
.huntly-live-run > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #dcf6e9; }
.huntly-live-run > span i { width: 11px; height: 11px; border-radius: 50%; background: #08a96b; box-shadow: 0 0 0 5px rgb(8 169 107 / 13%); }
.huntly-live-run > div strong, .huntly-live-run > div small { display: block; }
.huntly-live-run > div strong { color: #15241e; font-size: 14px; line-height: 1.35; }
.huntly-live-run > div small { margin-top: 4px; color: #738078; font-size: 11px; line-height: 1.4; }
.huntly-live-run dl { display: flex; gap: 18px; margin: 0; }
.huntly-live-run dl div { min-width: 70px; }
.huntly-live-run dt { color: #7a8780; font-size: 10px; }
.huntly-live-run dd { margin: 3px 0 0; color: #087c57; font-size: 17px; font-weight: 750; }

@media (max-width: 700px) {
  .huntly-live-run { grid-template-columns: 38px minmax(0, 1fr); }
  .huntly-live-run dl { grid-column: 1 / -1; padding-left: 52px; }
}

/* Zero-balance conversion modal. */
.huntly-zero-balance-open { overflow: hidden; }
.huntly-zero-balance[hidden] { display: none !important; }
.huntly-zero-balance {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgb(7 24 18 / 58%);
  backdrop-filter: blur(10px);
}
.huntly-zero-balance-dialog {
  position: relative;
  display: grid;
  width: min(100%, 920px);
  max-height: calc(100vh - 48px);
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 34px 100px rgb(0 32 22 / 32%);
  animation: huntly-zero-balance-in .24s ease-out;
}
.huntly-zero-balance-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(23 65 49 / 10%);
  border-radius: 50%;
  background: rgb(255 255 255 / 88%);
  color: #35423d;
  font: 400 27px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgb(22 60 45 / 8%);
}
.huntly-zero-balance-content { padding: 48px 46px 42px; }
.huntly-zero-balance-kicker {
  display: block;
  margin-bottom: 16px;
  color: #078d5c;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
}
.huntly-zero-balance-content h2 {
  max-width: 480px;
  margin: 0;
  color: #101715;
  font-size: clamp(31px, 4vw, 45px);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.huntly-zero-balance-content > p {
  max-width: 510px;
  margin: 17px 0 25px;
  color: #69756f;
  font-size: 15px;
  line-height: 1.55;
}
.huntly-zero-balance-content ul { display: grid; gap: 15px; margin: 0 0 28px; padding: 0; list-style: none; }
.huntly-zero-balance-content li { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 11px; }
.huntly-zero-balance-content li > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e2f8ed;
  color: #05975e;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}
.huntly-zero-balance-content li strong,
.huntly-zero-balance-content li small { display: block; }
.huntly-zero-balance-content li strong { color: #17221e; font-size: 14px; line-height: 1.35; }
.huntly-zero-balance-content li small { margin-top: 3px; color: #7a8580; font-size: 11px; line-height: 1.4; }
.huntly-zero-balance-primary {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  background: #08a766;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 15px 34px rgb(8 167 102 / 23%);
}
.huntly-zero-balance-primary:hover { background: #07985d; transform: translateY(-1px); }
.huntly-zero-balance-later {
  display: block;
  margin: 13px auto 0;
  border: 0;
  padding: 5px 10px;
  background: transparent;
  color: #7a8580;
  font-size: 11px;
  cursor: pointer;
}
.huntly-zero-balance-visual {
  position: relative;
  display: grid;
  min-height: 560px;
  place-items: center;
  overflow: hidden;
  padding: 52px 22px 18px;
  background: radial-gradient(circle at 52% 40%, #e9fff4 0, #dff8eb 36%, #ccefe0 100%);
}
.huntly-zero-balance-visual::before,
.huntly-zero-balance-visual::after {
  position: absolute;
  border: 1px solid rgb(8 160 99 / 13%);
  border-radius: 50%;
  content: "";
}
.huntly-zero-balance-visual::before { width: 410px; height: 410px; }
.huntly-zero-balance-visual::after { width: 300px; height: 300px; }
.huntly-zero-balance-visual > span {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 2;
  border: 1px solid rgb(8 154 95 / 14%);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgb(255 255 255 / 76%);
  color: #28745a;
  font-size: 10px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}
.huntly-zero-balance-visual img { position: relative; z-index: 1; width: 128%; max-width: 560px; height: auto; transform: translate(3%, 4%); filter: drop-shadow(0 28px 28px rgb(24 91 65 / 17%)); }
@keyframes huntly-zero-balance-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

@media (max-width: 760px) {
  .huntly-zero-balance { align-items: end; padding: 12px; }
  .huntly-zero-balance-dialog { max-height: calc(100dvh - 24px); grid-template-columns: 1fr; border-radius: 23px; overflow-y: auto; }
  .huntly-zero-balance-content { padding: 36px 24px 26px; }
  .huntly-zero-balance-content h2 { padding-right: 24px; font-size: 32px; }
  .huntly-zero-balance-content > p { margin: 13px 0 20px; font-size: 14px; }
  .huntly-zero-balance-content ul { gap: 12px; margin-bottom: 22px; }
  .huntly-zero-balance-visual { grid-row: 1; min-height: 188px; padding: 20px; }
  .huntly-zero-balance-visual > span { top: 18px; left: 18px; }
  .huntly-zero-balance-visual img { width: 68%; max-width: 310px; transform: translate(13%, 12%); }
  .huntly-zero-balance-close { top: 16px; right: 16px; }
}

@media (max-width: 420px) {
  .huntly-zero-balance { padding: 0; }
  .huntly-zero-balance-dialog { max-height: 100dvh; min-height: 100dvh; border-radius: 0; }
  .huntly-zero-balance-visual { min-height: 170px; }
  .huntly-zero-balance-content { padding: 28px 20px 22px; }
  .huntly-zero-balance-content h2 { font-size: 29px; }
}
