/* Dibble Board Desk — Hoophouse Grove account (Appily-OneHundredSeven)
   NOT Grower Badge / Hose Tag / Lid Gate / Marquee / Seal / Transplant Tag /
   Moisture Probe / L/R vault. */

body.page-a107-dibble {
  --db-max: var(--a107-max);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(139, 90, 43, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(21, 107, 69, 0.12), transparent 50%),
    var(--a107-field);
}

.db-mast {
  padding: calc(var(--a107-nav-h) + 1.5rem) 0 1.25rem;
}
.db-kicker {
  margin: 0 0 0.35rem;
  font-size: var(--a107-type-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--a107-spray-deep);
}
.db-mast h1 {
  margin: 0 0 0.5rem;
  font-family: var(--a107-font-display);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  color: var(--a107-ink);
}
.db-mast > p {
  margin: 0;
  max-width: 46ch;
  color: var(--a107-mute);
}

.db-stage { padding-bottom: 3rem; }

.db-loading {
  padding: 1rem 1.25rem;
  background: var(--a107-mist);
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-md);
  font-weight: 600;
  color: var(--a107-canopy-deep);
}

.page-a107-dibble .a107-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.2rem;
  border-radius: var(--a107-radius-md);
  font-family: var(--a107-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}
.page-a107-dibble .a107-btn:hover { transform: translateY(-1px); }
.page-a107-dibble .a107-btn:focus-visible {
  outline: 3px solid var(--a107-saffron);
  outline-offset: 2px;
}
.page-a107-dibble .a107-btn--primary {
  background: var(--a107-canopy);
  color: var(--a107-on-canopy);
  box-shadow: 3px 3px 0 var(--a107-soil);
}
.page-a107-dibble .a107-btn--berry {
  background: var(--a107-paprika);
  color: var(--a107-on-paprika);
  box-shadow: 3px 3px 0 var(--a107-soil);
}
.page-a107-dibble .a107-btn--ghost {
  background: transparent;
  color: var(--a107-canopy-deep);
  border-color: var(--a107-border);
}

.page-a107-dibble .a107-form { display: grid; gap: 0.9rem; }
.page-a107-dibble .a107-field { display: grid; gap: 0.35rem; }
.page-a107-dibble .a107-field > span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--a107-ink);
}
.page-a107-dibble .a107-field input {
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-sm);
  background: #fff;
  color: var(--a107-ink);
}
.page-a107-dibble .a107-field input:focus {
  outline: none;
  border-color: var(--a107-spray);
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
}
.page-a107-dibble .a107-form-subhead {
  margin: 1.25rem 0 0.5rem;
  font-family: var(--a107-font-display);
  font-size: 1rem;
}

/* Signed-out: wooden dibble board */
.db-gate {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

.db-board {
  position: relative;
  border: 3px solid #5C3A1E;
  border-radius: var(--a107-radius-lg);
  box-shadow: 5px 5px 0 var(--a107-soil);
  overflow: hidden;
  background: #8B5A2B;
}

.db-board-wood {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      92deg,
      rgba(255, 230, 180, 0.08) 0 2px,
      transparent 2px 18px
    ),
    linear-gradient(180deg, #A86F35 0%, #8B5A2B 45%, #6E4420 100%);
  opacity: 1;
}
.db-board-wood span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(60, 30, 10, 0.18);
}
.db-board-wood span:nth-child(1) { left: 28%; }
.db-board-wood span:nth-child(2) { left: 55%; }
.db-board-wood span:nth-child(3) { left: 78%; }

.db-holes {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 0.5rem;
  z-index: 1;
}

.db-hole {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 96px;
  padding: 0.85rem 0.75rem;
  border: 3px solid rgba(40, 22, 8, 0.45);
  border-radius: 50% / 42%;
  background: rgba(28, 42, 32, 0.72);
  color: #F3FFF8;
  cursor: pointer;
  font-family: var(--a107-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.db-hole-label {
  text-align: center;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.db-hole.is-active {
  background: var(--a107-mist);
  color: var(--a107-ink);
  box-shadow: inset 0 0 0 3px var(--a107-saffron);
  transform: translateY(-2px);
}
.db-hole:focus-visible {
  outline: 3px solid var(--a107-saffron);
  outline-offset: 2px;
}

.db-hole-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid currentColor;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.2);
}
.db-hole-ring--canopy { background: rgba(21, 107, 69, 0.45); }
.db-hole.is-active .db-hole-ring--canopy {
  background: var(--a107-canopy);
  border-color: var(--a107-canopy-deep);
  box-shadow: inset 0 0 0 6px rgba(255, 184, 0, 0.35);
}
.db-hole-ring--spray { background: rgba(30, 144, 255, 0.4); }
.db-hole.is-active .db-hole-ring--spray {
  background: var(--a107-spray);
  border-color: var(--a107-spray-deep);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.25);
}

.db-trough {
  position: relative;
  margin: 0.75rem 1rem 1.15rem;
  padding: 1.4rem 1.25rem 1.5rem;
  border-radius: var(--a107-radius-md);
  border: 3px solid #3E2A14;
  background: #3A2A1A;
  z-index: 1;
  overflow: hidden;
}
.db-trough-soil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 30%, rgba(90, 60, 30, 0.5) 0 8px, transparent 9px),
    radial-gradient(circle at 70% 60%, rgba(70, 45, 20, 0.45) 0 6px, transparent 7px),
    linear-gradient(180deg, #5A3D22 0%, #3A2A1A 55%, #2A1C10 100%);
  opacity: 0.95;
}
.db-trough > * { position: relative; z-index: 1; }
.db-trough h2 {
  margin: 0 0 0.4rem;
  font-family: var(--a107-font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  color: #FFF6E4;
  overflow-wrap: anywhere;
}
.db-lead {
  margin: 0 0 1.25rem;
  color: rgba(255, 246, 228, 0.9);
  max-width: 40ch;
}
.db-trough .a107-field > span { color: #FFF6E4; }
.db-trough .a107-form-subhead { color: var(--a107-saffron); }
.db-trough .a107-btn--ghost {
  color: #FFF6E4;
  border-color: rgba(255, 246, 228, 0.45);
}

.auth-split-panel[hidden] { display: none !important; }

.db-perks { display: grid; gap: 0.75rem; }
.db-perk {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-md);
  box-shadow: 3px 3px 0 rgba(28, 42, 32, 0.12);
  font-weight: 600;
  color: var(--a107-ink);
}
.db-perk-num {
  flex: 0 0 auto;
  font-family: var(--a107-font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--a107-paprika);
}

/* Signed-in desk */
.db-desk {
  background: var(--a107-mist);
  border: 3px solid var(--a107-soil);
  border-radius: var(--a107-radius-lg);
  box-shadow: var(--a107-shadow-hard);
  overflow: hidden;
}

.db-lot-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background:
    linear-gradient(120deg, #6E4420 0%, #8B5A2B 40%, var(--a107-canopy-deep) 100%);
  color: var(--a107-on-canopy);
}
.db-lot-id {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.db-lot-pin {
  width: 18px;
  height: 52px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--a107-saffron) 0 18%, #C4A06A 18% 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  position: relative;
}
.db-lot-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--a107-paprika);
}
.db-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--a107-saffron);
  color: var(--a107-saffron-ink);
  font-size: var(--a107-type-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.db-lot-strip h2 {
  margin: 0.25rem 0 0;
  font-family: var(--a107-font-display);
  font-size: 1.45rem;
  color: #fff;
}
.db-identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.db-identity-actions .a107-btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.db-desk-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 320px;
}

.db-pin-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.65rem;
  background: var(--a107-soil);
  border-right: 3px solid #5C3A1E;
}
.db-pin-rail .dash-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 2px solid transparent;
  border-radius: var(--a107-radius-sm);
  background: transparent;
  color: var(--a107-on-soil);
  font-family: var(--a107-font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.db-pin-rail .dash-nav-link.is-active {
  background: var(--a107-field);
  color: var(--a107-ink);
  border-color: var(--a107-saffron);
  transform: translateX(2px);
}
.db-pin-rail .dash-nav-link:focus-visible {
  outline: 2px solid var(--a107-saffron);
  outline-offset: 2px;
}
.db-pin {
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: var(--a107-spray);
  opacity: 0.55;
  flex-shrink: 0;
}
.db-pin-rail .dash-nav-link.is-active .db-pin {
  background: var(--a107-paprika);
  opacity: 1;
}

.db-desk-panels {
  position: relative;
  padding: 1.5rem 1.35rem 1.75rem;
  background: var(--a107-field);
  min-height: 280px;
}
.db-desk-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(255, 184, 0, 0.14), transparent 55%);
}
.db-desk-panels > * { position: relative; }

.dash-panel[hidden] { display: none !important; }

.db-panel-head { margin-bottom: 1.15rem; }
.db-panel-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.db-panel-head h3 {
  margin: 0 0 0.25rem;
  font-family: var(--a107-font-display);
  font-size: 1.25rem;
}
.db-panel-head p {
  margin: 0;
  color: var(--a107-mute);
}

.page-a107-dibble .a107-account-profile,
.page-a107-dibble .profile-grid {
  display: grid;
  gap: 0.75rem;
}
.page-a107-dibble .profile-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-md);
}
.page-a107-dibble .profile-item .k {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--a107-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-a107-dibble .profile-item .v {
  font-weight: 600;
  color: var(--a107-ink);
  overflow-wrap: anywhere;
}
.page-a107-dibble .profile-item .v.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.page-a107-dibble .order-list > *,
.page-a107-dibble .order-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  background: #fff;
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-md);
}
.page-a107-dibble .mini-copy {
  color: var(--a107-mute);
  font-size: 0.9rem;
}
.page-a107-dibble .btn.btn-soft,
.page-a107-dibble .order-row a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--a107-radius-sm);
  background: var(--a107-spray);
  color: var(--a107-on-spray);
  font-weight: 700;
  text-decoration: none;
}

.page-a107-dibble .notice {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--a107-radius-md);
  font-weight: 600;
  border: 2px solid var(--a107-border);
}
.page-a107-dibble .notice.success {
  background: var(--a107-mist);
  border-color: var(--a107-canopy);
  color: var(--a107-canopy-deep);
}
.page-a107-dibble .notice.warning {
  background: var(--a107-warm);
  border-color: var(--a107-saffron);
  color: var(--a107-saffron-ink);
}

.db-prefs { display: grid; gap: 0.75rem; }
.page-a107-dibble .a107-switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 2px solid var(--a107-border);
  border-radius: var(--a107-radius-md);
  cursor: pointer;
}
.page-a107-dibble .a107-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.page-a107-dibble .a107-switch-ui {
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--a107-border);
  position: relative;
  margin-top: 2px;
  transition: background 0.15s ease;
}
.page-a107-dibble .a107-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.page-a107-dibble .a107-switch input:checked + .a107-switch-ui {
  background: var(--a107-canopy);
}
.page-a107-dibble .a107-switch input:checked + .a107-switch-ui::after {
  transform: translateX(18px);
}
.page-a107-dibble .a107-switch-copy { display: grid; gap: 0.15rem; }
.page-a107-dibble .a107-switch-copy strong {
  font-family: var(--a107-font-display);
  font-size: 0.95rem;
}
.page-a107-dibble .a107-switch-copy small { color: var(--a107-mute); }

.toast#authMessage:not(:empty) {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--a107-saffron);
  color: var(--a107-saffron-ink);
  border-radius: var(--a107-radius-md);
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--a107-soil);
}
.toast#authMessage.visible.error {
  background: var(--a107-paprika);
  color: var(--a107-on-paprika);
}
.toast#authMessage.visible.success {
  background: var(--a107-canopy);
  color: var(--a107-on-canopy);
}

.db-foot-mini {
  padding: 0 0 2.5rem;
  font-size: 0.9rem;
  color: var(--a107-mute);
}
.db-foot-mini a { font-weight: 600; }

.db-trough .a107-btn--ghost:hover {
  background: rgba(255, 246, 228, 0.12);
  border-color: #FFF6E4;
  color: #FFF6E4;
}
.db-identity-actions .a107-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}
.db-lot-id { min-width: 0; }
.db-lot-id > div { min-width: 0; }
.db-lot-strip h2 { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .db-gate { grid-template-columns: 1fr; }
  .db-desk-body { grid-template-columns: 1fr; }
  .db-pin-rail {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem;
    border-right: none;
    border-bottom: 3px solid #5C3A1E;
    scrollbar-gutter: stable;
  }
  .db-pin-rail .dash-nav-link { flex: 0 0 auto; }
}

@media (max-width: 560px) {
  .db-lot-strip { flex-direction: column; align-items: flex-start; }
  .db-identity-actions { width: 100%; }
  .db-identity-actions .a107-btn { flex: 1 1 auto; }
  .db-holes { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .db-hole { min-height: 84px; font-size: 0.85rem; }
  .db-trough { margin: 0.65rem 0.65rem 1rem; padding: 1.15rem 1rem 1.25rem; }
  .db-desk-panels { padding: 1.15rem 1rem 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .db-hole,
  .db-pin-rail .dash-nav-link,
  .page-a107-dibble .a107-btn {
    transition: none;
  }
}
