/* Google Fonts loaded via <link> in HTML for non-blocking render */

:root {
  color-scheme: only light;
  --bg-fallback: #16081f;

  --ink: #18132a;

  --accent: #7c3aed;
  --accent-strong: #3b1c6e;
  --accent-soft: rgba(124, 58, 237, 0.13);
  --soft-shadow: 0 2px 8px rgba(16, 8, 38, 0.10), 0 6px 18px rgba(16, 8, 38, 0.12);

  --panel-radius: clamp(22px, 3vw, 28px);
  --panel-radius-mobile: 20px;
  --panel-padding: clamp(13px, 2.2vw, 20px);
  --panel-border: rgba(255, 255, 255, 0.22);
  --panel-bg-top: rgba(255, 255, 255, 0.82);
  --panel-bg-bottom: rgba(249, 245, 255, 0.74);
  --panel-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 6px 16px rgba(17, 7, 29, 0.12),
    0 18px 38px rgba(17, 7, 29, 0.16);
  --panel-solid-bg: #efe8f5;
  --field-shell-bg: rgba(255, 255, 255, 0.68);
  --field-shell-bg-strong: #f6f2fa;
  --control-solid-bg: #f8fbff;
  --control-panel-bg: #fafcff;
  --chrome-surface-bg: rgba(48, 33, 70, 0.68);
  --chrome-surface-bg-strong: rgba(64, 45, 91, 0.82);
  --chrome-surface-border: rgba(238, 226, 251, 0.18);
  --scrollbar-thumb: rgba(120, 102, 160, 0.6);

  /* Unified UI fills */
  --ui-card-border: rgba(86, 112, 138, 0.2);
  --ui-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 251, 255, 0.93));
  --ui-card-shadow: 0 6px 14px rgba(21, 43, 66, 0.08);
  --ui-item-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(246, 250, 254, 0.9));
  --ui-item-border: rgba(86, 112, 138, 0.14);

  /* Recipe hierarchy (primary focus) */
  --recipe-card-border: rgba(63, 108, 149, 0.34);
  --recipe-card-bg: linear-gradient(180deg, rgba(250, 253, 255, 0.99), rgba(240, 248, 255, 0.97));
  --recipe-card-shadow: 0 12px 28px rgba(21, 43, 66, 0.14);
  --recipe-row-border: rgba(68, 113, 155, 0.34);
  --recipe-row-bg: linear-gradient(180deg, rgba(242, 249, 255, 0.99), rgba(232, 243, 253, 0.96));
  --recipe-row-shadow: 0 7px 16px rgba(20, 45, 72, 0.11);
  --recipe-row-hover-border: rgba(55, 100, 143, 0.52);
  --recipe-row-hover-shadow: 0 12px 24px rgba(20, 45, 72, 0.16);
  --recipe-value-bg: rgba(71, 130, 184, 0.17);
  --recipe-value-border: rgba(59, 116, 168, 0.4);
  --recipe-value-text: #234f78;

  /* Typography */
  --font-ui: "Manrope", "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text-2xs: clamp(0.72rem, 0.9vw, 0.8rem);
  --text-xs: clamp(0.82rem, 1.2vw, 0.92rem);
  --text-sm: clamp(0.9rem, 1.4vw, 1.0rem);
  --text-md: clamp(0.98rem, 1.6vw, 1.1rem);
  --text-lg: clamp(1.08rem, 1.9vw, 1.22rem);
  --text-xl: clamp(1.24rem, 2.2vw, 1.52rem);
  --hero-control-height: 36px;
  --hero-control-padding-x: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Uygulama geneli ortak ✓ onay animasyonu. Hem Kaydet butonları hem de
   "Varsayılan Ayarlara Dön" butonları bu TEK sınıfı kullanır — kullanıcı
   hangi pencerede, hangi butonda olursa olsun aynı sade kurumsal ✓
   işaretini görür.

   Sade tasarım (önceki teal pill'in yerini aldı):
     • Dolgu / kenarlık / gölge YOK.
     • Sadece tek bir teal ✓ SVG.
     • opacity 0 → 1 → 0 fade-in/hold/fade-out.
     • Save butonlarının kendi arkaplanı da bu sınıf aktifken bastırılır
       ki görünüm reset butonlarıyla birebir aynı olsun. */
.is-btn-success {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #547984 !important;
  pointer-events: none !important;
  line-height: 1 !important;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.is-btn-success.is-btn-success-visible {
  opacity: 1;
}
.btn-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.btn-success-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.is-save-hidden {
  opacity: 0 !important;
  max-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.analysis-overlay-done-btn,
.analysis-overlay-reset-btn,
.analysis-coeff-done-btn,
#analysisCoeffResetBtn,
.fine-tune-save-btn,
.fine-tune-reset-btn,
.target-dlg-save-btn,
.target-dlg-reset-btn,
.fert-editor-save-btn,
.fert-editor-reset-btn,
#stockEditorSaveBtn,
#stockEditorResetBtn,
.fert-sel-done-btn,
.fert-sel-reset-btn {
  transition: opacity 0.6s ease, max-width 0.6s ease, padding 0.6s ease,
              margin 0.6s ease, border-width 0.6s ease,
              background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease !important;
  max-width: 200px;
  white-space: nowrap;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
  background-color: var(--bg-fallback);
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  overflow-x: clip;
  -ms-overflow-style: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(205, 186, 236, 0.72), rgba(130, 148, 196, 0.64));
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(220, 202, 245, 0.88), rgba(140, 160, 210, 0.8));
  background-clip: padding-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.58;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: var(--ink);
  background: transparent;
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(12px, 3vw, 24px)
    max(120px, calc(env(safe-area-inset-bottom) + 100px));
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.member-modal-open {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  top: calc(-1 * var(--member-modal-scroll-y, 0px));
}

body.overlay-lock {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  top: calc(-1 * var(--overlay-lock-scroll-y, 0px));
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(
    155deg,
    #16081f 0%,
    #2a0b39 28%,
    #5a1b72 56%,
    #9a2f88 78%,
    #d34f75 100%
  );
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 68% 50% at 12% 90%, rgba(255, 123, 76, 0.2) 0%, transparent 72%),
    radial-gradient(ellipse 54% 40% at 88% 8%, rgba(193, 53, 132, 0.24) 0%, transparent 67%);
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: -1;
  will-change: transform;
  /* Kendi compositor katmanına al, sayfanın geri kalanını etkilemesin */
  isolation: isolate;
  contain: layout style;
  animation-fill-mode: both;
}

.bg-shape-a {
  width: 520px;
  height: 520px;
  top: -220px;
  right: -190px;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(202, 78, 152, 0.28) 0%,
    transparent 65%
  );
  filter: blur(8px);
  transform: translate3d(0, 0, 0) scale(1);
  animation: bg-shape-drift-a 38s ease-in-out infinite;
}

.bg-shape-b {
  width: 430px;
  height: 430px;
  bottom: -200px;
  left: -160px;
  background: radial-gradient(
    circle at 55% 45%,
    rgba(255, 138, 72, 0.24) 0%,
    transparent 60%
  );
  filter: blur(10px);
  transform: translate3d(0, 0, 0) scale(1);
  animation: bg-shape-drift-b 46s ease-in-out infinite;
  animation-delay: -7s;
}

@keyframes bg-shape-drift-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  34% {
    transform: translate3d(-24px, 16px, 0) scale(1.03);
  }
  68% {
    transform: translate3d(20px, -14px, 0) scale(0.985);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1.008);
  }
}

@keyframes bg-shape-drift-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  30% {
    transform: translate3d(18px, -20px, 0) scale(1.024);
  }
  72% {
    transform: translate3d(-22px, 18px, 0) scale(0.982);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1.008);
  }
}

.pull-refresh {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -130%);
  z-index: 8;
  pointer-events: none;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(86, 168, 181, 0.30);
  background: rgba(14, 12, 32, 0.82);
  backdrop-filter: blur(10px);
  color: rgba(220, 210, 240, 0.88);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease, background-color 0.2s ease;
}

.pull-refresh.visible {
  opacity: 1;
}

.pull-refresh.ready {
  background: rgba(80, 30, 160, 0.88);
  border-color: rgba(124, 58, 237, 0.42);
}

.scroll-indicator {
  display: none;
}

body.member-modal-open .scroll-indicator,
body.overlay-lock .scroll-indicator {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .bg-shape {
    display: none;
  }

  .scroll-indicator {
    position: fixed;
    top: max(88px, calc(env(safe-area-inset-top) + 72px));
    right: max(4px, calc(env(safe-area-inset-right) + 4px));
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 24px));
    z-index: 92;
    display: block;
    width: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 6px 18px rgba(18, 7, 29, 0.18);
    pointer-events: none;
    opacity: 0.78;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .scroll-indicator.is-hidden {
    opacity: 0;
    transform: scaleY(0.92);
  }

  .scroll-indicator-thumb {
    position: absolute;
    left: 1px;
    width: 4px;
    min-height: 34px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(228, 214, 248, 0.92), rgba(129, 153, 211, 0.88));
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.14),
      0 6px 14px rgba(16, 7, 28, 0.22);
    transform: translateY(0);
    transition: transform 0.14s ease-out, height 0.18s ease-out;
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 30, 0.38);
  backdrop-filter: blur(3px) saturate(1.08);
  -webkit-backdrop-filter: blur(3px) saturate(1.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.loading-overlay-card {
  width: fit-content;
  min-width: 210px;
  max-width: min(340px, calc(100vw - 28px));
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(147, 181, 212, 0.42);
  background: linear-gradient(180deg, rgba(243, 250, 255, 0.97), rgba(232, 244, 253, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 26px rgba(8, 18, 30, 0.3);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(63, 128, 187, 0.32);
  border-top-color: rgba(39, 98, 150, 0.95);
  animation: status-spin 0.78s linear infinite;
  flex: 0 0 auto;
}

.loading-overlay-text {
  margin: 0;
  color: #244d73;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
  display: grid;
  /* Mobilde icerik azsa satirlari ekran boyuna yayma */
  grid-auto-rows: max-content;
  align-content: start;
  gap: clamp(12px, 2.1vw, 18px);
  animation: rise-in 0.5s cubic-bezier(0.22, 0.68, 0, 1.05);
}

.hero {
  padding: clamp(10px, 1.6vw, 16px) 0 4px;
  display: grid;
  gap: 2px;
  position: relative;
  max-width: 100%;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background-color: var(--chrome-surface-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--chrome-surface-border);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 22px rgba(17, 6, 30, 0.16);
  position: sticky;
  top: 0;
  z-index: 50;
  margin-left: auto;
  align-self: start;
  /* Sticky + backdrop-filter: GPU compositor katmanına zorla,
     scroll sırasında layout thrash önle */
  will-change: transform;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 8px;
}

.hero-actions .lang-switch,
.hero-actions .member-access-btn {
  flex: 0 1 auto;
}

.hero-trust {
  margin: 4px 0 0;
  padding: 7px 12px 7px 9px;
  align-self: start;
  max-width: min(100%, 560px);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid rgba(238, 226, 251, 0.14);
  border-radius: 999px;
  background-color: rgba(60, 40, 84, 0.58);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(18, 6, 30, 0.11);
  color: rgba(244, 238, 249, 0.7);
  line-height: 1.3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-trust.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-trust.is-dismissing {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-trust-mark {
  width: 36px;
  height: 32px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: none;
  box-shadow: none;
}

.hero-trust-logo {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  opacity: 0.45;
}

.hero-trust-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.hero-trust-title {
  color: rgba(251, 247, 255, 0.72);
  font-size: calc(var(--text-2xs) * 0.9);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

.hero-trust-text {
  color: rgba(239, 231, 247, 0.6);
  font-size: calc(var(--text-2xs) * 0.95);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hero-trust-text:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: rgba(130, 220, 160, 0.9);
  box-shadow: 0 0 4px rgba(130, 220, 160, 0.5);
  vertical-align: middle;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-trust-text::before {
    animation: none;
    opacity: 0.7;
  }
}

.hero-trust-install {
  margin-left: auto;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(236, 219, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(249, 242, 255, 0.92);
  font-size: calc(var(--text-2xs) * 0.96);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}

.install-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

.hero-trust-install:hover {
  color: rgba(255, 250, 255, 0.98);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 230, 178, 0.26);
  transform: translateY(-1px);
}

.hero-trust-install:active {
  transform: translateY(0);
}

.hero-trust-notice {
  flex-basis: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(196, 217, 255, 0.16);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(88, 122, 201, 0.14), rgba(120, 99, 188, 0.08));
  color: rgba(243, 247, 255, 0.84);
  font-size: calc(var(--text-2xs) * 0.95);
  font-weight: 600;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.member-access-btn {
  border: 1px solid rgba(236, 219, 255, 0.26);
  border-radius: 999px;
  background-color: var(--chrome-surface-bg-strong);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 14px rgba(17, 6, 30, 0.14);
  color: rgba(255, 246, 255, 0.92);
  min-height: var(--hero-control-height);
  padding: 6px var(--hero-control-padding-x);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.16s ease, box-shadow 0.35s ease;
}

.member-access-btn:active {
  transition: box-shadow 0s, transform 0.16s ease;
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.12);
}

.member-access-btn:hover {
  color: #ffffff;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  transform: translateY(-1px);
}

.member-access-btn.is-member {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.member-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
}
.member-access-btn.is-member .member-icon {
  display: none;
}

.lang-switch {
  display: block;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-actions .lang-switch {
  margin-left: 0;
}

.lang-switch::after {
  content: none;
}

.lang-switch .animated-select {
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.lang-switch .custom-select-icon {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  color: rgba(252, 245, 255, 0.7);
  transition: color 0.18s ease;
}
.lang-switch .custom-select-icon svg {
  width: 14px;
  height: 14px;
}
.lang-switch .custom-select-trigger:hover .custom-select-icon {
  color: rgba(255, 255, 255, 0.95);
}

.lang-switch .custom-select-trigger {
  position: relative;
  width: auto;
  min-height: var(--hero-control-height);
  border-radius: 999px;
  border: 1px solid rgba(236, 219, 255, 0.26);
  background-color: var(--chrome-surface-bg-strong);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  padding: 6px var(--hero-control-padding-x);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 14px rgba(17, 6, 30, 0.16);
}

.lang-switch .custom-select-trigger:hover {
  border-color: rgba(238, 220, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 10px 20px rgba(18, 6, 30, 0.3);
}

.lang-switch .custom-select-trigger:focus-visible {
  border-color: rgba(200, 156, 255, 0.84);
  box-shadow:
    0 0 0 3px rgba(155, 88, 232, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 18px rgba(18, 6, 30, 0.28);
}

.lang-switch .custom-select-value {
  color: rgba(252, 245, 255, 0.96);
  font-size: 0.73rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.lang-switch .custom-select-panel {
  left: auto;
  right: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(220px, 90vw);
  border-radius: 14px;
  border: 1px solid rgba(75, 36, 105, 0.2);
  background-color: var(--control-panel-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 245, 253, 0.9));
  box-shadow: 0 16px 30px rgba(31, 12, 48, 0.26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-switch .custom-option {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
  font-family: "Manrope", "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

.lang-switch .custom-option[lang="zh"] {
  font-weight: 500;
  letter-spacing: 0;
}

.lang-switch .custom-option + .custom-option {
  border-top: 1px solid rgba(49, 14, 64, 0.08);
}

.lang-switch .custom-option:hover {
  background: rgba(143, 47, 186, 0.1);
  color: var(--ink);
}

.lang-switch .custom-option.active {
  background: linear-gradient(140deg, rgba(143, 47, 186, 0.18), rgba(124, 181, 186, 0.2));
  color: var(--accent-strong);
}

.lang-switch .custom-option:disabled {
  color: #8b949b;
}

.lang-select {
  border: 1px solid rgba(236, 219, 255, 0.26);
  border-radius: 999px;
  background-color: var(--chrome-surface-bg-strong);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: #fff6ff;
  min-width: 0;
  padding: 5px 10px;
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 1.2;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.lang-select option {
  color: #24153f;
}

html[dir="rtl"] .hero-top {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lang-switch {
  margin-left: 0;
  margin-right: auto;
}


html[dir="rtl"] .hero-trust {
  padding: 10px 12px 10px 14px;
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-trust-text:not(:empty)::before {
  margin-right: 0;
  margin-left: 5px;
}

html[dir="rtl"] .lang-switch .custom-select-trigger {
  padding: 7px 11px;
}

html[dir="rtl"] .lang-switch .custom-select-value {
  text-align: right;
}


html[dir="rtl"] .lang-switch .custom-option {
  text-align: right;
}

html[dir="rtl"] .lang-select {
  padding: 7px 11px 7px 28px;
}

.member-modal {
  position: fixed;
  inset: 0;
  z-index: 135;
  display: grid;
  place-items: center;
  padding: 16px;
}

.member-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  margin: 0;
  padding: 0;
  background: rgba(14, 7, 24, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.member-modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 24px));
  border-radius: 18px;
  border: 1px solid rgba(240, 207, 174, 0.45);
  background: linear-gradient(168deg, rgba(255, 249, 240, 0.97), rgba(255, 243, 231, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 22px 44px rgba(16, 6, 22, 0.36);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.member-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(147, 95, 49, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #6f4023;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.member-modal-close:hover {
  background: rgba(255, 255, 255, 0.94);
}

html[dir="rtl"] .member-modal-close {
  right: auto;
  left: 10px;
}

.member-auth-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(166, 114, 64, 0.26);
  background: rgba(255, 246, 235, 0.66);
  width: fit-content;
}

.member-mode-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #7a4b23;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 6px 12px;
  min-height: 34px;
  cursor: pointer;
}

.member-mode-btn.is-active {
  border-color: rgba(155, 92, 36, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 239, 220, 0.84));
  color: #5b2f12;
}

.member-form {
  display: grid;
  gap: 12px;
}

.member-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.member-grid-single {
  grid-template-columns: 1fr;
}

.member-field {
  display: grid;
  gap: 5px;
}

.member-field-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #76512c;
  letter-spacing: 0.03em;
}

.member-input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(178, 136, 85, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.95));
  color: #2b190c;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 10px 11px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(89, 52, 17, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.member-input::placeholder {
  color: rgba(83, 56, 30, 0.56);
}

.member-input:focus-visible {
  border-color: rgba(203, 119, 30, 0.62);
  box-shadow:
    0 0 0 3px rgba(232, 144, 49, 0.18),
    0 7px 14px rgba(89, 52, 17, 0.12);
}

.member-form-hint {
  margin: -2px 0 0;
  color: #7f5b36;
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.member-register-btn {
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  min-height: 44px;
  background: linear-gradient(160deg, #b15a1a 0%, #8f3c09 68%, #763108 100%);
  color: #fffdf8;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 214, 0.3),
    0 10px 20px rgba(88, 39, 12, 0.24);
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.member-register-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 214, 0.34),
    0 13px 24px rgba(88, 39, 12, 0.3);
}

.member-register-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.member-secondary-btn,
.member-forget-btn {
  border: 1px solid rgba(147, 95, 49, 0.36);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 15px;
  background: rgba(255, 249, 240, 0.84);
  color: #734426;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
}

.member-secondary-btn:hover,
.member-forget-btn:hover {
  border-color: rgba(137, 78, 29, 0.52);
  background: rgba(255, 247, 235, 0.96);
}

.member-form-message {
  margin: 0;
  min-height: 1.15em;
  color: #7a4c27;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.member-form-message.is-error {
  color: #9b1e1e;
}

.member-form-message.is-success {
  color: #1f6f3d;
}

.member-summary {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(217, 159, 100, 0.36);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(255, 246, 234, 0.84));
}

.member-welcome {
  margin: 0;
  color: #3e230c;
  font-size: var(--text-md);
  font-weight: 800;
}

.member-badge-line {
  margin: 0;
  color: #91572b;
  font-size: var(--text-xs);
  font-weight: 700;
}

.member-summary-meta {
  margin: 0;
  color: #765438;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.panel {
  background-color: var(--panel-solid-bg);
  background-image: linear-gradient(168deg, var(--panel-bg-top), var(--panel-bg-bottom));
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  padding: var(--panel-padding);
  max-width: 100%;
  min-width: 0;
}

.input-panel {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  position: relative;
  isolation: isolate;
  z-index: 5;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  padding: clamp(16px, 2.8vw, 26px);
  border-radius: clamp(22px, 3vw, 28px);
  border-color: rgba(242, 236, 248, 0.24);
  background-color: var(--field-shell-bg-strong);
  background-image:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(
      156deg,
      #f4eff8 0%,
      #ede9f4 46%,
      #ece7f5 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 251, 255, 0.95),
    0 14px 34px rgba(17, 7, 29, 0.15),
    0 28px 54px rgba(17, 7, 29, 0.13);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.input-panel:focus-within {
  z-index: 60;
}

.field {
  display: grid;
  gap: 0;
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.field:focus-within {
  z-index: 20;
}

/* Plant + phase selectors: shared, clean and low-fatigue */
.plant-field,
.phase-field {
  padding: 0;
  position: relative;
  min-height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background-color: var(--field-shell-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.26));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 8px 18px rgba(25, 20, 44, 0.08);
  overflow: visible;
  transition: border-color 0.3s ease;
}

/* Plant card: always green-tinted border (plant identity) */
.plant-field {
  border-color: rgba(56, 142, 80, 0.22);
}

/* Phase card: green border only when unlocked (plant selected) */
.phase-field:not(.is-phase-locked) {
  border-color: rgba(56, 142, 80, 0.22);
}

/* ── Phase dependency connector — removed ─────────────────────────
   Dependency is already communicated via disabled state, lock icon,
   placeholder text and sequential field order. */
.phase-field::before {
  display: none;
}

/* ── Phase icon toggle: clock ↔ lock ─────────────────────────────── */

/* Default: clock shown, lock hidden */
.icon-phase-lock { display: none; }
.icon-phase-clock { display: block; }

/* Locked state: lock shown, clock hidden */
.phase-field.is-phase-locked .icon-phase-lock { display: block; }
.phase-field.is-phase-locked .icon-phase-clock { display: none; }

/* Icon inside trigger */
.custom-select-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(46, 110, 180, 0.07);
  color: #2e6eb4;
  transition: background 0.2s ease, color 0.2s ease;
}
.custom-select-icon svg {
  width: 18px;
  height: 18px;
}

.plant-field .custom-select-icon {
  background: rgba(56, 142, 80, 0.07);
  color: #388e50;
}

.plant-field .animated-select .custom-select-trigger,
.phase-field .animated-select .custom-select-trigger {
  min-height: 60px;
  padding: 10px 42px 10px 12px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: rgba(82, 99, 124, 0.22);
  border-radius: 15px;
  background-color: var(--control-solid-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 12px rgba(20, 34, 52, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.plant-field .animated-select .custom-select-trigger:hover,
.phase-field .animated-select .custom-select-trigger:hover {
  border-color: rgba(72, 101, 138, 0.40);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 6px 14px rgba(19, 33, 52, 0.10);
  transform: translateY(-1px);
}

/* Chevron arrow (right side) */
.plant-field .animated-select .custom-select-trigger::before,
.phase-field .animated-select .custom-select-trigger::before {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(64, 79, 102, 0.65);
  border-bottom: 2px solid rgba(64, 79, 102, 0.65);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Floating label above value */
.plant-field .animated-select .custom-select-trigger::after,
.phase-field .animated-select .custom-select-trigger::after {
  content: attr(data-field-label);
  position: absolute;
  top: 6px;
  left: 58px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: rgba(77, 91, 113, 0.68);
  text-transform: uppercase;
}

/* Value text — shift down to make room for label */
.plant-field .animated-select .custom-select-value,
.phase-field .animated-select .custom-select-value {
  color: #24384f;
  font-weight: 600;
  letter-spacing: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
  padding-top: 10px;
}

/* Open state: plant (green ring) */
.plant-field .animated-select.open .custom-select-trigger {
  border-color: rgba(56, 142, 80, 0.50);
  box-shadow: 0 0 0 3px rgba(56, 142, 80, 0.12), 0 12px 24px rgba(16, 48, 33, 0.14);
  transform: none;
}
.plant-field .animated-select.open .custom-select-icon {
  background: rgba(56, 142, 80, 0.14);
}

/* Open state: phase (blue ring) */
.phase-field .animated-select.open .custom-select-trigger {
  border-color: rgba(46, 110, 180, 0.50);
  box-shadow: 0 0 0 3px rgba(46, 110, 180, 0.12), 0 12px 24px rgba(19, 42, 66, 0.14);
  transform: none;
}
.phase-field .animated-select.open .custom-select-icon {
  background: rgba(46, 110, 180, 0.14);
}

.plant-field .animated-select.open .custom-select-trigger::before,
.phase-field .animated-select.open .custom-select-trigger::before {
  transform: translateY(-20%) rotate(-135deg);
}

/* Disabled state: dimmed with pattern (not just color) */
.plant-field .animated-select.disabled .custom-select-trigger,
.phase-field .animated-select.disabled .custom-select-trigger {
  border-color: rgba(124, 133, 148, 0.18);
  background: linear-gradient(180deg, #f4f6f9, #edf1f5);
  color: #7b8798;
  box-shadow: none;
  cursor: not-allowed;
}
.plant-field .animated-select.disabled .custom-select-icon,
.phase-field .animated-select.disabled .custom-select-icon {
  opacity: 0.35;
  background: rgba(90, 110, 140, 0.06);
  color: #8a9aaa;
}

.plant-field .animated-select.disabled .custom-select-trigger::before,
.phase-field .animated-select.disabled .custom-select-trigger::before {
  border-right-color: rgba(126, 136, 150, 0.45);
  border-bottom-color: rgba(126, 136, 150, 0.45);
}

/* RTL overrides for plant/phase selectors */
html[dir="rtl"] .plant-field .animated-select .custom-select-trigger,
html[dir="rtl"] .phase-field .animated-select .custom-select-trigger {
  padding: 10px 12px 10px 42px;
  flex-direction: row-reverse;
}
html[dir="rtl"] .plant-field .animated-select .custom-select-trigger::before,
html[dir="rtl"] .phase-field .animated-select .custom-select-trigger::before {
  right: auto;
  left: 14px;
  border-right: none;
  border-bottom: 2px solid rgba(64, 79, 102, 0.65);
  border-left: 2px solid rgba(64, 79, 102, 0.65);
  transform: translateY(-60%) rotate(45deg);
}
html[dir="rtl"] .plant-field .animated-select .custom-select-trigger::after,
html[dir="rtl"] .phase-field .animated-select .custom-select-trigger::after {
  left: auto;
  right: 58px;
}
html[dir="rtl"] .plant-field .animated-select .custom-select-value,
html[dir="rtl"] .phase-field .animated-select .custom-select-value {
  text-align: right;
}
/* RTL: flip option hover indent and active border */
html[dir="rtl"] .plant-field .animated-select .custom-option:hover,
html[dir="rtl"] .phase-field .animated-select .custom-option:hover {
  padding-left: 16px;
  padding-right: 20px;
}
html[dir="rtl"] .plant-field .animated-select .custom-option.active {
  padding-left: 16px;
  padding-right: 20px;
  border-left: none;
  border-right: 3px solid #388e50;
}
html[dir="rtl"] .phase-field .animated-select .custom-option.active {
  padding-left: 16px;
  padding-right: 20px;
  border-left: none;
  border-right: 3px solid #2e6eb4;
}
html[dir="rtl"] .plant-field .animated-select .custom-option,
html[dir="rtl"] .phase-field .animated-select .custom-option {
  text-align: right;
}

/* ── Dropdown panels (plant / phase) ── */
.plant-field .animated-select .custom-select-panel,
.phase-field .animated-select .custom-select-panel {
  border-color: rgba(84, 104, 129, 0.22);
  background-color: var(--control-panel-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.93));
  box-shadow: 0 20px 44px rgba(18, 35, 54, 0.20);
  border-radius: 16px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 145, 175, 0.40) transparent;
}

/* Plant panel: green-tinted scrollbar */
.plant-field .animated-select .custom-select-panel {
  scrollbar-color: rgba(56, 142, 80, 0.35) transparent;
}
.plant-field .animated-select .custom-select-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 142, 80, 0.50), rgba(56, 142, 80, 0.35));
  background-clip: padding-box;
}

/* Phase panel: blue-tinted scrollbar */
.phase-field .animated-select .custom-select-panel {
  scrollbar-color: rgba(46, 110, 180, 0.35) transparent;
}
.phase-field .animated-select .custom-select-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46, 110, 180, 0.50), rgba(46, 110, 180, 0.35));
  background-clip: padding-box;
}

/* ── Options: better touch targets + typography ── */
.plant-field .animated-select .custom-option,
.phase-field .animated-select .custom-option {
  padding: 13px 16px;
  min-height: 46px;
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  border-top: 1px solid rgba(60, 90, 130, 0.06);
  transition: background-color 0.14s ease, color 0.14s ease, padding-left 0.18s ease;
  touch-action: manipulation;
}
.plant-field .animated-select .custom-option:first-of-type,
.phase-field .animated-select .custom-option:first-of-type {
  border-top: none;
}

/* Plant option hover: green tint */
.plant-field .animated-select .custom-option:hover {
  background: rgba(56, 142, 80, 0.08);
  padding-left: 20px;
}
.plant-field .animated-select .custom-option:active:not(:disabled) {
  background: rgba(56, 142, 80, 0.15);
}

/* Phase option hover: blue tint */
.phase-field .animated-select .custom-option:hover {
  background: rgba(46, 110, 180, 0.08);
  padding-left: 20px;
}
.phase-field .animated-select .custom-option:active:not(:disabled) {
  background: rgba(46, 110, 180, 0.15);
}

.plant-field .animated-select .custom-option:focus-visible,
.phase-field .animated-select .custom-option:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(46, 110, 180, 0.18);
}

/* Active (selected) option */
.plant-field .animated-select .custom-option.active {
  background: linear-gradient(140deg, rgba(56, 142, 80, 0.13), rgba(56, 142, 80, 0.07));
  color: #1b5e2e;
  font-weight: 700;
  padding-left: 20px;
  border-left: 3px solid #388e50;
}
.phase-field .animated-select .custom-option.active {
  background: linear-gradient(140deg, rgba(46, 110, 180, 0.13), rgba(46, 110, 180, 0.07));
  color: #1a4472;
  font-weight: 700;
  padding-left: 20px;
  border-left: 3px solid #2e6eb4;
}

/* ╔══════════════════════════════════════════════╗
   ║   PLANT SELECTION OVERLAY                    ║
   ╚══════════════════════════════════════════════╝ */
.plant-sel-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 24, 18, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.plant-sel-overlay.hidden {
  display: none;
}
.plant-sel-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Panel: bottom-sheet style */
.plant-sel-panel {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(180deg, #f6faf7 0%, #ffffff 12%, #ffffff 100%);
  box-shadow: 0 20px 48px rgba(12, 36, 20, 0.22);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}
.plant-sel-overlay.is-visible .plant-sel-panel {
  transform: translateY(0) scale(1);
}

/* Header */
.plant-sel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f2 50%, #f6faf7 100%);
  border-bottom: 1px solid rgba(56, 142, 80, 0.12);
  flex-shrink: 0;
}
.plant-sel-header-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(56, 142, 80, 0.10);
  color: #2e7d42;
  flex-shrink: 0;
}
.plant-sel-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1b3a24;
  letter-spacing: 0.01em;
}
.plant-sel-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(56, 142, 80, 0.08);
  color: #3a6b45;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.plant-sel-close:focus-visible {
  outline: 3px solid rgba(56, 142, 80, 0.18);
  outline-offset: 2px;
}

/* Search bar */
.plant-sel-search-wrap {
  position: relative;
  padding: 12px 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(56, 142, 80, 0.08);
}
.plant-sel-search-wrap::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2.5px solid rgba(56, 142, 80, 0.50);
  border-radius: 50%;
  transform: translateY(-60%);
  pointer-events: none;
}
.plant-sel-search-wrap::after {
  content: "";
  position: absolute;
  left: 41px;
  top: calc(50% + 5px);
  width: 8px;
  height: 2.5px;
  border-radius: 999px;
  background: rgba(56, 142, 80, 0.48);
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}
.plant-sel-search {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid rgba(56, 142, 80, 0.20);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #1b3a24;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  padding: 10px 14px 10px 42px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.plant-sel-search::placeholder {
  color: #6b9a76;
  font-weight: 500;
}
.plant-sel-search:focus {
  border-color: rgba(56, 142, 80, 0.50);
  box-shadow: 0 0 0 3px rgba(56, 142, 80, 0.12);
}

/* Scrollable list */
.plant-sel-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 142, 80, 0.30) transparent;
  padding: 4px 0;
}
.plant-sel-list::-webkit-scrollbar {
  width: 5px;
}
.plant-sel-list::-webkit-scrollbar-track {
  margin: 6px 0;
  background: transparent;
}
.plant-sel-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(56, 142, 80, 0.30);
}
.plant-sel-list::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 142, 80, 0.50);
}

/* Plant option items */
.plant-sel-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #24384f;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.4;
  text-align: left;
  padding: 14px 20px;
  min-height: 50px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(56, 142, 80, 0.05);
  transition: background 0.14s ease, padding-left 0.18s ease, color 0.14s ease;
}
.plant-sel-item:last-child {
  border-bottom: none;
}
.plant-sel-item:active {
  background: rgba(56, 142, 80, 0.13);
}
.plant-sel-item:focus-visible {
  outline: none;
  background: rgba(56, 142, 80, 0.08);
  box-shadow: inset 0 0 0 2px rgba(56, 142, 80, 0.18);
}
.plant-sel-item.is-active {
  background: linear-gradient(135deg, rgba(56, 142, 80, 0.10), rgba(56, 142, 80, 0.05));
  color: #1b5e2e;
  font-weight: 700;
  padding-left: 24px;
  border-left: 3.5px solid #388e50;
}

@media (hover: hover) {
  .plant-sel-close:hover {
    background: rgba(56, 142, 80, 0.16);
    color: #1b5e2e;
  }

  .plant-sel-item:hover {
    background: rgba(56, 142, 80, 0.06);
    padding-left: 26px;
  }
}

/* Empty state */
.plant-sel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  color: #7b9a85;
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
}

/* RTL support */
html[dir="rtl"] .plant-sel-header {
  flex-direction: row-reverse;
}
html[dir="rtl"] .plant-sel-search {
  padding: 10px 42px 10px 14px;
  text-align: right;
}
html[dir="rtl"] .plant-sel-search-wrap::before {
  left: auto;
  right: 28px;
}
html[dir="rtl"] .plant-sel-search-wrap::after {
  left: auto;
  right: 41px;
}
html[dir="rtl"] .plant-sel-item {
  text-align: right;
}
html[dir="rtl"] .plant-sel-item.is-active {
  padding-left: 20px;
  padding-right: 24px;
  border-left: none;
  border-right: 3.5px solid #388e50;
}

@media (hover: hover) {
  html[dir="rtl"] .plant-sel-item:hover {
    padding-left: 20px;
    padding-right: 26px;
  }
}

/* ── Desktop: centered card instead of bottom sheet ── */
@media (min-width: 640px) {
  .plant-sel-overlay {
    align-items: center;
  }
  .plant-sel-panel {
    max-width: 480px;
    max-height: 70vh;
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(12, 36, 20, 0.28);
    transform: translateY(20px) scale(0.97);
  }
  .plant-sel-overlay.is-visible .plant-sel-panel {
    transform: translateY(0) scale(1);
  }
}

select {
  appearance: none;
  border: 1px solid rgba(70, 38, 95, 0.2);
  border-radius: 14px;
  background-color: var(--control-solid-bg);
  background-image: linear-gradient(180deg, #ffffff, #f6f2fb);
  color: var(--ink);
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(49, 14, 64, 0.05);
  transition: border-color 0.24s ease, box-shadow 0.24s ease;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--soft-shadow);
}

select:disabled {
  color: #8a8199;
  background: linear-gradient(180deg, #f6f3fa, #f0edf4);
  box-shadow: none;
}

.native-select {
  display: none;
}

.animated-select {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.animated-select.open {
  z-index: 30;
}

.custom-select-trigger {
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  border: 1px solid rgba(70, 38, 95, 0.2);
  border-radius: 14px;
  background-color: var(--control-solid-bg);
  background-image: linear-gradient(180deg, #ffffff, #f6f2fb);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(49, 14, 64, 0.05);
  transition: border-color 0.24s ease, box-shadow 0.35s ease, transform 0.22s ease;
  overflow: hidden;
}

.custom-select-trigger:active:not(:disabled) {
  transition: box-shadow 0s;
  box-shadow: inset 0 0 0 9999px rgba(80, 118, 168, 0.09);
}

.custom-select-trigger:hover {
  border-color: rgba(95, 48, 129, 0.34);
  box-shadow: var(--soft-shadow);
}

.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--soft-shadow);
}

.custom-select-value {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animated-select.disabled .custom-select-trigger {
  color: #8a8199;
  background: linear-gradient(180deg, #f6f3fa, #f0edf4);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.custom-select-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  z-index: 30;
  border: 1px solid rgba(75, 36, 105, 0.2);
  border-radius: 14px;
  background-color: var(--control-panel-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(250, 248, 255, 0.9));
  box-shadow: 0 18px 42px rgba(31, 12, 48, 0.24);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 148, 200, 0.55) rgba(240, 236, 248, 0.3);
  -ms-overflow-style: auto;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top center;
  pointer-events: none;
  will-change: transform, opacity, max-height;
  transition: max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease, transform 0.24s ease;
}

.animated-select.open .custom-select-panel {
  max-height: min(340px, 44vh);
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select-panel::-webkit-scrollbar {
  width: 6px;
}

.custom-select-panel::-webkit-scrollbar-track {
  margin: 8px 0;
  border-radius: 999px;
  background: rgba(240, 236, 248, 0.25);
}

.custom-select-panel::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(188, 170, 218, 0.72), rgba(148, 130, 182, 0.6));
  background-clip: padding-box;
}

.custom-select-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(200, 184, 228, 0.88), rgba(160, 142, 196, 0.76));
  background-clip: padding-box;
}

.custom-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.custom-option + .custom-option {
  border-top: 1px solid rgba(49, 14, 64, 0.08);
}

.custom-option:hover {
  background: rgba(143, 47, 186, 0.1);
}

.custom-option:active:not(:disabled) {
  transition: background-color 0s;
  background: rgba(80, 118, 168, 0.13);
}

.custom-option.active {
  background: linear-gradient(140deg, rgba(143, 47, 186, 0.18), rgba(124, 181, 186, 0.2));
  color: var(--accent-strong);
  font-weight: 700;
}

.custom-option:disabled {
  color: #8b949b;
  cursor: not-allowed;
}

.custom-select-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid rgba(49, 14, 64, 0.08);
  background:
    linear-gradient(180deg, rgba(252, 250, 255, 0.76), rgba(252, 250, 255, 0.98) 26%),
    rgba(252, 250, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -8px 18px rgba(31, 12, 48, 0.08);
}

.calculate-field {
  margin-top: 2px;
}

.calculate-btn {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #7c3aed, #6028cc);
  color: #fff;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 4px 12px rgba(80, 20, 160, 0.28),
    0 8px 24px rgba(60, 10, 130, 0.18);
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.calculate-btn-icon {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.calculate-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #8b46ff, #7032e0);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px rgba(80, 20, 160, 0.34),
    0 12px 30px rgba(60, 10, 130, 0.20);
}
.calculate-btn:hover:not(:disabled) .calculate-btn-icon {
  transform: translateX(2px);
}
.calculate-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 6px rgba(40, 10, 90, 0.22),
    0 1px 4px rgba(60, 10, 130, 0.14);
}
.calculate-btn:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}
.calculate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  background: linear-gradient(180deg, #9e7fd8, #8a6cc4);
  box-shadow: none;
  transform: none;
}
/* Check mode: yeşil ton */
body.is-check-mode .calculate-btn:not(:disabled) {
  background: linear-gradient(180deg, #3a9e58, #338a4a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px rgba(51, 138, 74, 0.35),
    0 2px 6px rgba(20, 60, 30, 0.18);
}
body.is-check-mode .calculate-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #42b163, #3a9e58);
}

/* ── Fertilizer selection panel ── */
.fertilizer-field {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: var(--field-shell-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16));
  box-shadow: 0 2px 8px rgba(25, 20, 44, 0.04);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.fertilizer-field:hover {
  box-shadow: 0 4px 14px rgba(25, 20, 44, 0.08);
  border-color: rgba(46, 110, 180, 0.22);
}

/* Card header (summary trigger) */
.fertilizer-card-header {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  gap: 10px;
  user-select: none;
}
.fertilizer-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(46, 110, 180, 0.08);
  color: #2e6eb4;
}
.fertilizer-card-icon svg { width: 18px; height: 18px; }
.fertilizer-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fertilizer-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #3a4a5c;
  letter-spacing: 0.04em;
}
.fertilizer-card-subtitle {
  font-size: 10.5px;
  color: #8a9aaa;
  font-weight: 500;
}
.fertilizer-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #2e6eb4;
  background: rgba(46, 110, 180, 0.08);
  border-radius: 6px;
  padding: 2px 7px;
  display: none;
}
.fertilizer-card-badge.has-values { display: inline-block; }
.fertilizer-card-arrow {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(64, 79, 102, 0.55);
  border-bottom: 2px solid rgba(64, 79, 102, 0.55);
  transform: rotate(-45deg);
  margin-left: 2px;
}

/* ╔══════════════════════════════════════════════╗
   ║   FERTILIZER SELECTION OVERLAY               ║
   ╚══════════════════════════════════════════════╝ */
.fert-sel-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px;
}
.fert-sel-overlay.hidden { display: none; }

.fert-sel-panel {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(180deg, #f6f9fd 0%, #ffffff 10%, #ffffff 100%);
  box-shadow: 0 20px 48px rgba(12, 20, 36, 0.22);
  overflow: hidden;
  animation: fertSelFadeIn 0.22s ease;
}
@keyframes fertSelFadeIn {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@media (min-width: 640px) {
  .fert-sel-overlay { padding: 16px; }
  .fert-sel-panel { max-width: 520px; }
}

/* Topbar */
.fert-sel-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #e8eef5 0%, #f0f4f9 50%, #f6f9fd 100%);
  border-bottom: 1px solid rgba(46, 110, 180, 0.10);
  flex-shrink: 0;
}
.fert-sel-header-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(46, 110, 180, 0.10);
  color: #2e6eb4;
  flex-shrink: 0;
}
.fert-sel-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3048;
  letter-spacing: 0.01em;
}
.fert-sel-close {
  flex-shrink: 0;
  appearance: none;
  border: none;
  border-radius: 9px;
  background: rgba(46, 110, 180, 0.09);
  color: #2e6eb4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.fert-sel-close:hover {
  background: rgba(46, 110, 180, 0.18);
}

/* Toolbar — 2 rows */
.fert-sel-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid rgba(90, 110, 140, 0.08);
  flex-shrink: 0;
}
.fert-sel-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.fert-sel-toolbar-bottom {
  padding-top: 0;
  padding-bottom: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.fert-sel-toolbar-bottom .fert-sel-toggle-all {
  margin-left: auto;
}
.fert-sel-search-wrap {
  flex: 1;
  min-width: 120px;
  position: relative;
}
.fert-sel-search {
  width: 100%;
  border: 1px solid rgba(90, 110, 140, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 52px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #2a3a4a;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fert-sel-search:focus {
  border-color: rgba(46, 110, 180, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 110, 180, 0.10);
}
.fert-sel-search::placeholder { color: #9aabbf; }
.fert-sel-count {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #9aabbf;
  pointer-events: none;
  white-space: nowrap;
}
.fert-sel-toggle-all {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #4a6a8a;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.fert-sel-toggle-all:hover {
  background: rgba(90, 122, 156, 0.14);
  color: #2a5a8a;
}
.fert-sel-toggle-all.is-remove-all {
  border-color: rgba(180, 60, 40, 0.25);
  background: rgba(180, 60, 40, 0.06);
  color: #a03828;
}
.fert-sel-toggle-all.is-remove-all:hover {
  background: rgba(180, 60, 40, 0.14);
  border-color: rgba(180, 60, 40, 0.4);
}

/* Scrollable list */
.fert-sel-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 110, 180, 0.25) transparent;
}
.fert-sel-list::-webkit-scrollbar { width: 5px; }
.fert-sel-list::-webkit-scrollbar-track { background: transparent; }
.fert-sel-list::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(46, 110, 180, 0.25); }

/* Footer — editors row + action row */
.fert-sel-footer {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}
.fert-sel-footer-editors {
  display: flex;
  align-items: stretch;
}
.fert-sel-footer-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(90, 110, 140, 0.08);
}
.fert-sel-close-btn {
  appearance: none;
  margin-left: auto;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
  color: #4a6a8a;
  padding: 9px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.fert-sel-close-btn:hover { background: rgba(90, 122, 156, 0.12); }
.fert-sel-done-btn {
  appearance: none;
  border: 1px solid rgba(46, 110, 180, 0.28);
  background: rgba(46, 110, 180, 0.07);
  color: #2e6eb4;
  padding: 9px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 44px;
}
.fert-sel-done-btn:hover {
  background: rgba(46, 110, 180, 0.13);
  border-color: rgba(46, 110, 180, 0.45);
}
.fert-sel-done-btn:active { background: rgba(46, 110, 180, 0.18); }

/* Mobile: bottom-sheet compact adjustments */
@media (max-width: 480px) {
  .fert-sel-toolbar-row {
    padding: 6px 12px;
    gap: 6px;
  }
  .fert-sel-search {
    padding: 7px 10px;
    font-size: 12px;
  }
  .fert-sel-footer-action {
    padding: 8px 12px;
  }
}

/* RTL support */
html[dir="rtl"] .fert-sel-topbar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .fert-sel-toolbar {
  flex-direction: row-reverse;
}

html[dir="rtl"] .fert-unit-group + .fert-unit-group {
  padding-left: 0;
  border-left: none;
  padding-right: 10px;
  border-right: 1px solid rgba(90, 110, 140, 0.12);
}
html[dir="rtl"] .fert-sel-toolbar-bottom .fert-sel-toggle-all {
  margin-left: 0;
  margin-right: auto;
}
html[dir="rtl"] .fert-trigger-row {
  margin-right: 0;
  margin-left: auto;
  padding-right: 0;
  padding-left: 12px;
}
html[dir="rtl"] .fertilizer-card-arrow {
  transform: rotate(135deg);
  margin-left: 0;
  margin-right: 2px;
}

.fertilizer-items-section {
  padding: 8px 14px 6px;
}

.fertilizer-item.is-hidden {
  display: none;
}

.fertilizer-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  margin-bottom: 4px;
}

.fertilizer-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.fertilizer-item:hover {
  background: rgba(90, 122, 156, 0.08);
  border-color: rgba(90, 122, 156, 0.15);
}

.fertilizer-item.is-checked {
  background: rgba(46, 110, 180, 0.07);
  border-color: rgba(46, 110, 180, 0.2);
}

.fertilizer-item-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  appearance: none;
  border: 1.5px solid rgba(90, 110, 140, 0.4);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.fertilizer-item-checkbox:checked {
  background: #2e6eb4;
  border-color: #2e6eb4;
}

.fertilizer-item-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1.5px;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.fertilizer-item-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.fertilizer-item-name {
  font-size: 12px;
  font-weight: 500;
  color: #2a3a4c;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fertilizer-selection-count {
  font-size: 11px;
  color: #6a7a8a;
  padding: 2px 14px 8px;
}

@media (max-width: 480px) {
  .fertilizer-items-grid {
    grid-template-columns: 1fr;
  }
}

body.is-check-mode .fertilizer-items-grid {
  grid-template-columns: 1fr;
}

/* ── Mode selector (Reçete Oluştur / Reçeteni Kontrol Et) ── */
/* ── Mode selector — segmented control ────────────────────────── */
.mode-selector {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  min-width: 0;
  overflow: hidden;
}

.mode-btn {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(60, 70, 85, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  touch-action: manipulation;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-btn-icon {
  flex-shrink: 0;
  opacity: 0.38;
  transition: opacity 0.2s ease;
}

.mode-btn-label {
  pointer-events: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-btn.is-active {
  background: #fff;
  color: #2c3e50;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mode-btn.is-active .mode-btn-icon {
  opacity: 1;
}

.mode-btn:active {
  transform: scale(0.97);
}

.mode-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .mode-btn:not(.is-active):hover {
    background: rgba(0, 0, 0, 0.03);
    color: rgba(60, 70, 85, 0.85);
  }
}

body.is-check-mode .mode-btn.is-active {
  color: #27563a;
}

body.is-check-mode .input-panel {
  background-image:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(
      156deg,
      #f0f4ee 0%,
      #eaf0e8 46%,
      #e6f0ec 100%
    );
  border-color: rgba(220, 238, 224, 0.32);
}

@media (max-width: 520px) {
  .mode-btn {
    min-height: 44px;
    padding: 8px 10px;
  }
}

/* ── Fertilizer unit toggle row (check mode) ── */
.fert-unit-row {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.08);
}

body.is-check-mode .fert-unit-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.fert-unit-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.fert-unit-group + .fert-unit-group {
  padding-left: 10px;
  border-left: 1px solid rgba(90, 110, 140, 0.12);
}

.fert-unit-group[hidden] {
  display: none !important;
}

.fert-unit-group-label {
  font-size: 11px;
  font-weight: 800;
  color: #4a5a6a;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.fert-unit-group-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fert-unit-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 5px 10px;
  min-width: 42px;
  font-size: 12px;
  font-weight: 600;
  color: #6a8aaa;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fert-unit-btn.is-active {
  background: #2e6eb4;
  color: #fff;
  border-color: #2e6eb4;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(46, 110, 180, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .fert-unit-btn:hover {
    background: rgba(46, 110, 180, 0.1);
    border-color: rgba(46, 110, 180, 0.3);
  }
}

.fert-unit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.16);
}

/* ── Fertilizer amount inputs (check mode) ── */
.fert-amount-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

body.is-check-mode .fert-amount-wrap {
  display: flex;
}

body.is-check-mode .fertilizer-item:not(.is-checked) .fert-amount-wrap {
  opacity: 0.48;
}

.fert-amount-shell {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(90, 110, 140, 0.25);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fert-amount-step-btn {
  appearance: none;
  border: none;
  border-radius: 0;
  background: rgba(90, 110, 140, 0.07);
  color: #5a6a7a;
  cursor: pointer;
  width: 28px;
  align-self: stretch;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
  min-height: 32px;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .fert-amount-step-btn:hover {
    background: rgba(46, 110, 180, 0.12);
    color: #2e6eb4;
  }
}

.fert-amount-step-btn:active {
  background: rgba(46, 110, 180, 0.18);
}

.fert-amount-step-btn:focus-visible {
  outline: none;
  background: rgba(46, 110, 180, 0.14);
}

.fert-amount-step-btn:disabled {
  cursor: not-allowed;
  color: #94a3b2;
  background: rgba(232, 237, 242, 0.6);
}

.fert-amount-step-btn:first-child {
  border-right: 1px solid rgba(90, 110, 140, 0.14);
}
.fert-amount-step-btn:last-child {
  border-left: 1px solid rgba(90, 110, 140, 0.14);
}

.fert-amount-input {
  width: 62px;
  border: none;
  background: transparent;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #2a3a4a;
  text-align: right;
  outline: none;
  transition: color 0.15s ease;
}
.fert-amount-input::placeholder {
  color: #a0b0c0;
  font-weight: 500;
}

.fert-amount-input:disabled {
  cursor: not-allowed;
  color: #94a3b2;
  background: transparent;
}

.fert-amount-shell:focus-within {
  border-color: #5a7a9c;
  background: rgba(255, 255, 255, 0.96);
}

.fert-amount-unit {
  font-size: 11px;
  color: #6a7a8a;
  flex-shrink: 0;
  min-width: 16px;
  padding-right: 2px;
}

.fert-amount-input::-webkit-inner-spin-button,
.fert-amount-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fert-amount-input[type="number"] {
  -moz-appearance: textfield;
}

/* ── Analysis shared input styles (used inside overlay) ── */

.analysis-unit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.06);
}
.analysis-unit-row .analysis-coeff-trigger-btn,
.analysis-soil-unit-hint .analysis-coeff-trigger-btn {
  margin-left: auto;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  min-height: 0;
}

.analysis-unit-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.18);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #7a8a9a;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.analysis-unit-btn.is-active {
  background: rgba(46, 110, 180, 0.15);
  border-color: rgba(46, 110, 180, 0.4);
  color: #1a5a9a;
  font-weight: 700;
}

.analysis-list-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: 400px;
}

.analysis-list-scroll::-webkit-scrollbar {
  width: 3px;
}

.analysis-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.analysis-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(90, 110, 140, 0.18);
  border-radius: 2px;
}

.analysis-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 15px;
  padding: 8px 14px 10px;
}

.analysis-input-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 38px;
}

.analysis-input-control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(90, 110, 140, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.analysis-input-row:focus-within .analysis-input-control {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(46, 110, 180, 0.18);
}

.analysis-stepper-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #5a7a90;
  width: 32px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.12s ease, background 0.12s ease;
  touch-action: manipulation;
}

.analysis-stepper-btn-minus {
  border-right: 1px solid rgba(90, 110, 140, 0.08);
  border-radius: 8px 0 0 8px;
  color: #c0574a;
}

.analysis-stepper-btn-plus {
  border-left: 1px solid rgba(90, 110, 140, 0.08);
  border-radius: 0 8px 8px 0;
  color: #2e7d42;
}

@media (hover: hover) and (pointer: fine) {
  .analysis-stepper-btn-minus:hover {
    background: rgba(192, 87, 74, 0.08);
    color: #a03a2e;
  }

  .analysis-stepper-btn-plus:hover {
    background: rgba(56, 142, 80, 0.08);
    color: #1b5e2e;
  }
}

.analysis-stepper-btn:active {
  background: rgba(46, 110, 180, 0.12);
}

.analysis-stepper-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(79, 135, 189, 0.2);
}

.analysis-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 120px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 44px 0 0;
  box-shadow: none;
}

.analysis-input-suffix {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.2;
}

.analysis-input-element {
  font-size: 10.5px;
  font-weight: 700;
  color: #3a5a72;
  letter-spacing: 0.02em;
}

.analysis-inline-unit {
  font-size: 8px;
  font-weight: 600;
  color: #8aa0b4;
  letter-spacing: 0.01em;
}

.analysis-input-field {
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #2a3a4a;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  transition: color 0.15s ease;
}

.analysis-input-field:focus {
  color: #163854;
}

.analysis-input-field::placeholder {
  color: #b0c0d0;
}

@media (max-width: 560px) {
  .analysis-inputs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    padding: 6px 10px 8px;
  }

  .analysis-stepper-btn {
    width: 32px;
  }

  .analysis-input-shell {
    padding-right: 40px;
    max-width: 100px;
  }
}

/* ── Analysis Card (single entry point) ── */
.analysis-card-field {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: var(--field-shell-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16));
  box-shadow: 0 2px 8px rgba(25, 20, 44, 0.04);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.analysis-card-field:hover {
  box-shadow: 0 4px 14px rgba(25, 20, 44, 0.08);
  border-color: rgba(46, 110, 180, 0.22);
}
.analysis-card-field:active {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.10));
}
.analysis-card-header {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  gap: 10px;
  user-select: none;
  position: relative;
}
.analysis-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(46, 110, 180, 0.08);
  color: #2e6eb4;
}
.analysis-card-icon svg {
  width: 18px;
  height: 18px;
}
.analysis-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.analysis-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #3a4a5c;
  letter-spacing: 0.04em;
}
.analysis-card-subtitle {
  font-size: 10.5px;
  color: #8a9aaa;
  font-weight: 500;
}
.analysis-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #2e6eb4;
  background: rgba(46, 110, 180, 0.08);
  border-radius: 6px;
  padding: 2px 7px;
  display: none;
}
.analysis-card-badge.has-values {
  display: inline-block;
}
.analysis-card-arrow {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(64, 79, 102, 0.55);
  border-bottom: 2px solid rgba(64, 79, 102, 0.55);
  transform: rotate(-45deg);
  margin-left: 2px;
}

/* ── Analysis Overlay ── */
.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.analysis-overlay.hidden {
  display: none;
}
.analysis-overlay-panel {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 8, 30, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: analysisFadeIn 0.2s ease;
}
@keyframes analysisFadeIn {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@media (min-width: 640px) {
  .analysis-overlay {
    padding: 16px;
  }
}
/* ── Analysis Overlay Topbar (tabs + close) ── */
.analysis-overlay-topbar {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(90, 110, 140, 0.12);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(244, 247, 252, 0.95));
  flex-shrink: 0;
}
.analysis-overlay-tabs {
  display: flex;
  flex: 1;
  gap: 0;
  padding: 0;
}
.analysis-overlay-tab {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 14px 20px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #8a9aaa;
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s ease, background 0.15s ease;
}
.analysis-tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.42;
  overflow: visible;
  transition: opacity 0.2s ease;
}
.analysis-overlay-tab.is-active .analysis-tab-icon {
  opacity: 1;
}
.analysis-overlay-tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s ease;
}
.analysis-overlay-tab.is-active {
  color: #2e6eb4;
  font-weight: 700;
}
.analysis-overlay-tab.is-active::after {
  background: #2e6eb4;
  height: 3px;
}
.analysis-overlay-tab:hover:not(.is-active) {
  color: #4a6a8a;
  background: rgba(46, 110, 180, 0.03);
}
.analysis-overlay-close {
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: transparent;
  color: #6a7a8a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.analysis-overlay-close:hover {
  background: rgba(46, 110, 180, 0.07);
  color: #2e6eb4;
}

.analysis-overlay-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.18);
}

/* ── Analysis Overlay Body & Tab Panels ── */
.analysis-overlay-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 200px;
}
.analysis-overlay-body::-webkit-scrollbar { width: 4px; }
.analysis-overlay-body::-webkit-scrollbar-track { background: transparent; }
.analysis-overlay-body::-webkit-scrollbar-thumb { background: rgba(90, 110, 140, 0.25); border-radius: 2px; }
.analysis-tab-panel {
  display: none;
}
.analysis-tab-panel.is-active {
  display: block;
}
.analysis-soil-unit-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.06);
}
.analysis-soil-unit-hint > #soilUnitHint {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #5a7a6a;
  background: rgba(56, 142, 80, 0.08);
  border: 1px solid rgba(56, 142, 80, 0.18);
  border-radius: 6px;
}

/* ── Analysis Overlay Footer ── */
.analysis-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(245, 248, 252, 0.95);
}
.analysis-overlay-footer-right {
  display: flex;
  align-items: center;
}
.analysis-overlay-footer-right > .analysis-overlay-done-btn {
  margin-left: 8px;
}
/* Hassas Ayar trigger button */
.analysis-coeff-trigger-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(46, 110, 180, 0.22);
  background: rgba(46, 110, 180, 0.06);
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2e6eb4;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.analysis-coeff-trigger-btn:hover {
  background: rgba(46, 110, 180, 0.12);
  border-color: rgba(46, 110, 180, 0.35);
}
.analysis-overlay-reset-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 4px 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8a4820;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.analysis-overlay-reset-btn:hover {
  opacity: 1;
  text-decoration: underline;
}
.analysis-overlay-reset-btn:active {
  opacity: 0.9;
}
.analysis-overlay-close-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4a6a8a;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease;
}
.analysis-overlay-close-btn:hover { background: rgba(90, 122, 156, 0.12); }
.analysis-overlay-done-btn {
  appearance: none;
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  cursor: pointer;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.analysis-overlay-done-btn:hover {
  background: #2560a0;
  box-shadow: 0 2px 8px rgba(46, 110, 180, 0.25);
}

/* safe-area bottom padding for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .analysis-overlay-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ══════════════════════════════════════════════════════════════
   Analysis Coefficient Overlay
   ══════════════════════════════════════════════════════════════ */
.analysis-coeff-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.analysis-coeff-overlay.hidden { display: none; }
.analysis-coeff-panel {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 8, 30, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: analysisCoeffFadeIn 0.22s ease;
}
@keyframes analysisCoeffFadeIn {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@media (min-width: 640px) {
  .analysis-coeff-overlay { padding: 16px; }
}
/* Topbar */
.analysis-coeff-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #e8eef5 0%, #f0f4f9 50%, #f6f9fd 100%);
  border-bottom: 1px solid rgba(46, 110, 180, 0.10);
  flex-shrink: 0;
}
.analysis-coeff-header-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(46, 110, 180, 0.10);
  color: #2e6eb4;
}
.analysis-coeff-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #2a3a4c;
  margin: 0;
}
.analysis-coeff-close {
  flex-shrink: 0;
  appearance: none;
  border: none;
  border-radius: 8px;
  background: rgba(46, 110, 180, 0.08);
  color: #2e6eb4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.analysis-coeff-close:hover { background: rgba(46, 110, 180, 0.16); }

.analysis-coeff-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.18);
}
/* Tabs */
.analysis-coeff-tabs {
  display: flex;
  border-bottom: 1px solid rgba(90, 110, 140, 0.10);
  flex-shrink: 0;
  background: rgba(248, 250, 253, 0.95);
}
.analysis-coeff-tab {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 8px 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(60, 80, 100, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  transition: color 0.18s ease;
}
.analysis-coeff-tab svg {
  overflow: visible;
}
.analysis-coeff-tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 14px;
  right: 14px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.18s ease;
}
.analysis-coeff-tab.is-active { color: #2e6eb4; }
.analysis-coeff-tab.is-active::after { background: #2e6eb4; }
/* Hint */
.analysis-coeff-hint {
  font-size: 11px;
  color: #556878;
  padding: 8px 16px 4px;
  line-height: 1.5;
  flex-shrink: 0;
}
/* Body */
.analysis-coeff-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 110, 180, 0.2) transparent;
}
.analysis-coeff-body::-webkit-scrollbar { width: 4px; }
.analysis-coeff-body::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(46, 110, 180, 0.2); }
/* Element rows */
.analysis-coeff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.07);
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.analysis-coeff-row:last-child { border-bottom: none; }
.analysis-coeff-row:hover { background: rgba(46, 110, 180, 0.03); }
.analysis-coeff-el-name {
  flex-shrink: 0;
  width: 50px;
  font-size: 12px;
  font-weight: 700;
  color: #3a4a5c;
}
.analysis-coeff-row.is-modified .analysis-coeff-el-name {
  color: #2e6eb4;
}
.analysis-coeff-slider-wrap {
  flex: 1;
  min-width: 0;
}
.analysis-coeff-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(46, 110, 180, 0.16);
  border-radius: 3px;
  outline: none;
}
.analysis-coeff-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2e6eb4;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(46, 110, 180, 0.3);
  cursor: pointer;
}
.analysis-coeff-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2e6eb4;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(46, 110, 180, 0.3);
  cursor: pointer;
}
.analysis-coeff-row.is-modified .analysis-coeff-slider {
  background: rgba(46, 110, 180, 0.24);
}
.analysis-coeff-input {
  flex-shrink: 0;
  width: 58px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid rgba(90, 110, 140, 0.22);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #2a3a4c;
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
  box-shadow: inset 0 1px 2px rgba(46, 110, 180, 0.06);
}

.analysis-coeff-input::-webkit-outer-spin-button,
.analysis-coeff-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.analysis-coeff-input:focus {
  outline: none;
  border-color: #2e6eb4;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.12);
}
.analysis-coeff-row.is-modified .analysis-coeff-input {
  border-color: rgba(46, 110, 180, 0.35);
  color: #2e6eb4;
  background: rgba(46, 110, 180, 0.04);
}
/* Footer */
.analysis-coeff-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 16px;
  padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(245, 248, 252, 0.95);
  flex-shrink: 0;
}
.analysis-coeff-reset-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8a4820;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  align-self: center;
}
.analysis-coeff-reset-btn:hover { opacity: 1; text-decoration: underline; }
.analysis-coeff-reset-btn:active {
  opacity: 0.9;
}
.analysis-coeff-footer-right {
  display: flex;
  align-items: center;
}
.analysis-coeff-footer-right > .analysis-coeff-done-btn {
  margin-left: 8px;
}
.analysis-coeff-close-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4a6a8a;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease;
}
.analysis-coeff-close-btn:hover { background: rgba(90, 122, 156, 0.12); }
.analysis-coeff-done-btn {
  appearance: none;
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  cursor: pointer;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease;
}
.analysis-coeff-done-btn:hover { background: #2560a0; }

.result-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  min-width: 0;
  border-color: rgba(190, 214, 234, 0.26);
  background: linear-gradient(
    168deg,
    rgba(249, 252, 255, 0.84),
    rgba(241, 247, 252, 0.78)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 26px rgba(18, 42, 66, 0.12),
    0 24px 48px rgba(18, 42, 66, 0.14);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.result-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 2px solid rgba(90, 110, 140, 0.18);
  box-shadow: none;
}

.result-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: rgba(60, 75, 100, 0.58);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 14px 9px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Bottom indicator bar */
.result-tab::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 16px;
  right: 16px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.22s ease, left 0.22s ease, right 0.22s ease;
}

.result-tab-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.4;
  transition: opacity 0.22s ease;
}

/* Tab content: label + sublabel stacked */
.result-tab-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  pointer-events: none;
}

.result-tab-label {
  pointer-events: none;
  line-height: 1.2;
}

.result-tab-sublabel {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  opacity: 0.55;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.result-tab:active:not(.is-active) {
  background: rgba(80, 118, 168, 0.06);
}

.result-tab:hover:not(.is-active) {
  color: rgba(60, 75, 100, 0.88);
  background: rgba(90, 110, 140, 0.05);
}

.result-tab:hover:not(.is-active) .result-tab-icon {
  opacity: 0.72;
}

.result-tab:hover:not(.is-active) .result-tab-sublabel {
  opacity: 0.75;
}

.result-tab:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(124, 58, 237, 0.35);
}

/* Active tab: violet — unified for all three tabs */
.result-tab[data-tab="recipe"].is-active,
.result-tab[data-tab="tanks"].is-active,
.result-tab[data-tab="report"].is-active {
  background: rgba(124, 58, 237, 0.07);
  color: #5b21b6;
  font-weight: 700;
}

.result-tab[data-tab="recipe"].is-active .result-tab-icon,
.result-tab[data-tab="tanks"].is-active .result-tab-icon,
.result-tab[data-tab="report"].is-active .result-tab-icon {
  opacity: 1;
}

.result-tab[data-tab="recipe"].is-active .result-tab-sublabel,
.result-tab[data-tab="tanks"].is-active .result-tab-sublabel,
.result-tab[data-tab="report"].is-active .result-tab-sublabel {
  opacity: 0.75;
}

/* Indicator bar: same violet bar for all — icons provide shape differentiation for a11y */
.result-tab[data-tab="recipe"].is-active::after,
.result-tab[data-tab="tanks"].is-active::after,
.result-tab[data-tab="report"].is-active::after {
  background: #7c3aed;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 2px 2px 0 0;
}

.result-tab-panel {
  display: none;
  gap: 16px;
}

.result-tab-panel.is-active {
  display: grid;
}

/* ── TANKLAR Tab ─────────────────────────────────────────────────── */

.tanks-wrap {
  display: grid;
  gap: 16px;
}

.tanks-controls {
  border: 1px solid rgba(133, 151, 175, 0.10);
  border-radius: 14px;
  background: rgba(248, 252, 255, 0.5);
  box-shadow: none;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tanks-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 188px));
  gap: 10px;
  align-items: stretch;
  justify-content: start;
}

@media (max-width: 980px) {
  .tanks-controls-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tanks-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tanks-control-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0;
  min-width: 0;
  min-height: 64px;
  padding: 0;
  border: 1px solid rgba(86, 112, 138, 0.09);
  border-left-width: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  overflow: hidden;
}

.tanks-control-item:focus-within {
  box-shadow: 0 0 0 3px rgba(46, 110, 180, 0.08);
}

.tanks-control-item--stock-ec {
  border-left-color: rgba(53, 104, 160, 0.22);
}

.tanks-control-item--tank-volume {
  border-left-color: rgba(43, 110, 74, 0.20);
}

.tanks-control-item--dosing-volume {
  border-left-color: rgba(46, 110, 180, 0.18);
}

.tanks-control-item--target-ec {
  border-left-color: rgba(176, 125, 32, 0.20);
}

.tanks-control-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #8a9aac;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.tanks-control-main {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  padding: 8px 10px;
}

.tanks-control-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.tanks-stepper {
  display: grid;
  grid-template-rows: 1fr 1fr;
  border-left: 1px solid rgba(94, 116, 143, 0.10);
  background: rgba(248, 252, 255, 0.5);
}

.tanks-stepper-btn {
  appearance: none;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  width: 40px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #46627f;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
  min-height: 0;
}

.tanks-stepper-btn:focus-visible {
  outline: none;
  background: rgba(74, 124, 171, 0.14);
  box-shadow: inset 0 0 0 2px rgba(46, 110, 180, 0.22);
}

.tanks-stepper-btn + .tanks-stepper-btn {
  border-top: 1px solid rgba(86, 112, 138, 0.18);
}

.tanks-stepper-btn:active {
  background: rgba(74, 124, 171, 0.18);
}

.tanks-stepper-btn:disabled {
  cursor: not-allowed;
  color: #94a3b2;
  background: rgba(232, 237, 242, 0.82);
}

.tanks-stepper-input {
  width: 72px;
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 1.06rem;
  font-weight: 750;
  font-family: inherit;
  color: #22364f;
  text-align: left;
  outline: none;
  box-shadow: none;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.tanks-stepper-input.is-invalid {
  color: #b42e2e;
}

.tanks-stepper-input::-webkit-inner-spin-button,
.tanks-stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tanks-stepper-input[type="number"] {
  -moz-appearance: textfield;
}

.tanks-stepper-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a8da3;
  white-space: nowrap;
  line-height: 1.1;
}

.tanks-control-result {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(86, 112, 138, 0.09);
  border-left: 2px solid rgba(53, 104, 160, 0.22);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.tanks-control-result-value {
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 650;
  color: #4a6580;
  min-height: 20px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.tanks-control-item--tank-volume .tanks-stepper-input,
.tanks-control-item--dosing-volume .tanks-stepper-input {
  width: 84px;
}

.tanks-card-grid {
  display: grid;
  gap: 14px;
  transition: opacity 0.16s ease;
}

.tanks-card-grid.is-updating {
  opacity: 0.82;
}

.tanks-empty-msg {
  text-align: center;
  color: rgba(100, 116, 139, 0.85);
  font-size: 14px;
  padding: 24px 12px;
}

.tanks-status-card {
  border: 1px solid var(--ui-card-border);
  border-radius: 13px;
  background: var(--ui-card-bg);
  box-shadow: var(--ui-card-shadow);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.tanks-status-card.is-warning {
  border-color: rgba(191, 99, 36, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.tanks-status-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #8a4b17;
}

.tanks-status-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.tanks-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tanks-status-btn {
  appearance: none;
  border: 1px solid rgba(46, 110, 180, 0.18);
  border-radius: 10px;
  background: rgba(46, 110, 180, 0.08);
  color: #1f4f86;
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
  touch-action: manipulation;
}

.tanks-status-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 110, 180, 0.16);
}

.tanks-tank-card {
  border: 1px solid var(--ui-card-border);
  border-radius: 13px;
  background: var(--ui-card-bg);
  box-shadow: var(--ui-card-shadow);
  overflow: hidden;
}

.tanks-tank-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(250, 252, 255, 0.98) 0%, rgba(230, 238, 247, 0.98) 100%);
  color: #22364f;
  border-bottom: 1px solid rgba(122, 142, 166, 0.18);
}

.tanks-tank-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.tanks-tank-ec-badge {
  background: linear-gradient(180deg, rgba(46, 110, 180, 0.12), rgba(46, 110, 180, 0.08));
  border-color: rgba(46, 110, 180, 0.18);
  color: #245789;
}

.tanks-tank-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 308px);
  justify-items: stretch;
  align-content: start;
}

.tanks-tank-meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(124, 145, 170, 0.16);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  color: #52657d;
  text-align: center;
  white-space: nowrap;
}

.tanks-warning-panel {
  padding: 0 12px 12px;
}

.tanks-warning-panel:empty {
  display: none;
}

.tanks-warning-panel .warning-queue-stack {
  margin-top: 10px;
}

.tanks-fert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 7px;
  padding: 10px;
}

.tanks-fert-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--ui-card-border);
  border-radius: 9px;
  background: var(--control-solid-bg);
  transition: box-shadow 0.15s;
}

@media (hover: hover) and (pointer: fine) {
  .tanks-transfer-btn:hover {
    background: rgba(46, 110, 180, 0.08);
    color: #2e6eb4;
  }

  .tanks-fert-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }

  .tanks-status-btn:hover {
    background: rgba(46, 110, 180, 0.12);
    border-color: rgba(46, 110, 180, 0.3);
  }
}

.tanks-fert-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.tanks-fert-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 5px;
  flex-shrink: 0;
}

.tanks-fert-name {
  flex: 1 1 auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tanks-fert-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.tanks-fert-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  width: 100%;
  border: 1px solid rgba(94, 116, 143, 0.18);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.tanks-transfer-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 32px;
  flex-shrink: 0;
  border-left: 1px solid rgba(90, 110, 140, 0.14);
  background: linear-gradient(180deg, rgba(249, 253, 255, 0.96), rgba(244, 249, 254, 0.95));
}

.tanks-transfer-btn {
  width: 100%;
  min-height: 23px;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #557089;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.tanks-transfer-btn + .tanks-transfer-btn {
  border-top: 1px solid rgba(90, 110, 140, 0.14);
}

.tanks-transfer-btn:focus-visible {
  outline: none;
  background: rgba(74, 124, 171, 0.12);
  box-shadow: inset 0 0 0 2px rgba(46, 110, 180, 0.18);
}

.tanks-transfer-btn:active {
  background: rgba(74, 124, 171, 0.16);
}

.tanks-transfer-btn:disabled {
  cursor: not-allowed;
  color: #a8b6c5;
  background: rgba(236, 241, 247, 0.9);
}

.tanks-fert-stepper-value {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}

@media (max-width: 480px) {
  .tanks-controls {
    padding: 8px;
    gap: 6px;
    border-radius: 12px;
  }
  .tanks-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .tanks-control-item,
  .tanks-control-result {
    border-radius: 10px;
  }
  .tanks-control-item {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 32px;
  }
  .tanks-control-main {
    padding: 6px 7px;
    gap: 2px;
  }
  .tanks-control-label {
    font-size: 9.5px;
  }
  .tanks-control-result {
    padding: 6px 8px;
    width: 100%;
    grid-column: 1 / -1;
  }
  .tanks-fert-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .tanks-stepper-input {
    width: 52px;
    font-size: 0.88rem;
  }
  .tanks-stepper-btn {
    width: 32px;
    font-size: 13px;
  }
  .tanks-control-item--tank-volume .tanks-stepper-input,
  .tanks-control-item--dosing-volume .tanks-stepper-input {
    width: 56px;
  }
  .tanks-control-result-value {
    font-size: 15px;
  }
  .tanks-tank-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tanks-tank-meta {
    width: 100%;
  }
}

/* ── /TANKLAR Tab ────────────────────────────────────────────────── */

.report-wrap {
  display: grid;
  gap: 12px;
}

.report-section {
  border: 1px solid var(--ui-card-border);
  border-radius: 13px;
  background: var(--ui-card-bg);
  box-shadow: var(--ui-card-shadow);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.report-section-head {
  display: grid;
  gap: 6px;
}

.report-section-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 750;
  letter-spacing: 0;
  color: #173958;
}

.report-score-list {
  display: grid;
  gap: 8px;
}

.report-score-row {
  border: 1px solid var(--ui-item-border);
  border-radius: 10px;
  background: var(--ui-item-bg);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.report-score-row.is-selected {
  border-color: rgba(65, 120, 176, 0.45);
  box-shadow: 0 0 0 3px rgba(65, 120, 176, 0.11);
}

.report-score-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.report-score-phase {
  color: #24445f;
  font-size: var(--text-sm);
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-score-value {
  color: #2a567d;
  font-size: var(--text-sm);
  font-weight: 750;
  font-variant-numeric: tabular-nums lining-nums;
}

.report-score-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(198, 214, 228, 0.72);
  overflow: hidden;
}

.report-score-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #87b7dd, #3f7db3);
}

.report-element-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 7px;
}

.report-element-card {
  border: 1px solid rgba(86, 112, 138, 0.18);
  border-left-width: 3px;
  border-radius: 11px;
  padding: 8px 9px 8px 8px;
  display: grid;
  gap: 6px;
  min-height: 0;
  align-content: start;
  overflow: visible;
  box-shadow: 0 5px 12px rgba(22, 44, 67, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .report-element-card:hover {
    border-color: rgba(72, 104, 138, 0.38);
    box-shadow: 0 10px 20px rgba(22, 44, 67, 0.13);
    transform: translateY(-2px);
  }
}

.report-element-card:focus-within {
  border-color: rgba(72, 104, 138, 0.38);
  box-shadow: 0 10px 20px rgba(22, 44, 67, 0.13);
  transform: translateY(-2px);
}

.report-element-top {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 4px;
  min-width: 0;
}

.report-element-name {
  margin: 0;
  color: #1f3650;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.report-status-chip {
  display: inline-block;
  align-self: start;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: var(--text-2xs);
  letter-spacing: 0.01em;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
  text-align: center;
}

.report-element-ppm {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(90, 110, 140, 0.1);
}

.report-element-ppm-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  color: #4a6278;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
}

.report-ppm-label {
  opacity: 0.7;
  font-weight: 600;
  flex-shrink: 0;
}

.report-ppm-value {
  font-weight: 700;
  color: #2f455f;
  text-align: right;
}

.report-empty {
  border: 1px dashed rgba(97, 118, 142, 0.38);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.8);
  color: #5e7388;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
}

.result-metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.result-metrics-strip--report {
  margin: 0;
}

.result-metric-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(83, 111, 140, 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 253, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.result-metric-label {
  margin: 0;
  color: #5b7086;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.result-metric-value {
  color: #203e5b;
  font-size: var(--text-sm);
  font-weight: 750;
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;
}

.summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(86, 112, 138, 0.10);
  border-radius: 10px;
  background: rgba(248, 252, 255, 0.5);
  box-shadow: none;
}
.summary-card[hidden] {
  display: none;
}
/* Expand to 4 columns when dilution card is visible */
.summary-card:has(.summary-item-dilution:not([hidden])) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-item {
  border: 1px solid rgba(86, 112, 138, 0.09);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
}

.summary-item-main {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
}

.summary-item-adjustable {
  padding: 0;
  overflow: hidden;
  gap: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
}

.summary-item-adjustable .summary-item-main {
  grid-template-rows: minmax(30px, auto) auto;
  align-content: stretch;
  gap: 4px;
  padding: 8px 10px;
}

.summary-item-adjustable .summary-label-row {
  align-items: flex-start;
  min-height: 30px;
}

.summary-item-adjustable .summary-label {
  line-height: 1.2;
}

.summary-stepper {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-self: stretch;
  border-left: 1px solid rgba(86, 112, 138, 0.10);
  background: rgba(248, 252, 255, 0.6);
}

.summary-stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #2b4f71;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.summary-stepper-btn + .summary-stepper-btn {
  border-top: 1px solid rgba(86, 112, 138, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .summary-stepper-btn:hover {
    background: rgba(74, 124, 171, 0.12);
    color: #214766;
  }
}

.summary-stepper-btn:active {
  background: rgba(74, 124, 171, 0.18);
}

.summary-stepper-btn:focus-visible {
  outline: none;
  background: rgba(74, 124, 171, 0.14);
  box-shadow: inset 0 0 0 2px rgba(46, 110, 180, 0.2);
}

.summary-stepper-btn.is-disabled,
.summary-stepper-btn:disabled {
  cursor: not-allowed;
  color: #9eaec0;
  background: rgba(236, 241, 247, 0.9);
}

.summary-item-dose {
  border-left: 2px solid rgba(43, 110, 74, 0.30);
}

.summary-item-ec {
  border-left: 2px solid rgba(176, 125, 32, 0.28);
}

.summary-item-tank {
  border-left: 2px solid rgba(53, 104, 160, 0.28);
}

.summary-label-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.summary-icon {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

.summary-icon-dose { color: #2b6e4a; }
.summary-icon-ec { color: #b07d20; }
.summary-icon-tank { color: #3568a0; }

.summary-label {
  margin: 0;
  font-size: var(--text-2xs);
  color: #8a9aac;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.summary-item-dose h2 {
  margin: 0;
  font-size: var(--text-sm);
  color: #3a5a78;
  line-height: 1.26;
  letter-spacing: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums lining-nums;
  word-break: break-word;
}

.summary-item strong {
  font-size: var(--text-sm);
  color: #3a5a78;
  font-weight: 650;
  line-height: 1.26;
  font-variant-numeric: tabular-nums lining-nums;
  word-break: break-word;
  overflow-wrap: break-word;
}

.summary-value-editable {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  width: fit-content;
  min-height: 1.6rem;
  border-radius: 8px;
  padding: 1px 4px;
  cursor: text;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.summary-value-editable:hover,
.summary-value-editable:focus-visible {
  background: rgba(63, 118, 171, 0.10);
  box-shadow: inset 0 0 0 1px rgba(63, 118, 171, 0.22);
  outline: none;
}

.summary-value-editable.is-editing {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(47, 106, 162, 0.38), 0 0 0 3px rgba(79, 140, 198, 0.20);
}

.summary-value-editable.disabled {
  opacity: 0.6;
  cursor: default;
  background: transparent;
  box-shadow: none;
}

/* ── Dilution Card (inside summary-card grid) ─────────────────── */

.summary-item-dilution {
  border-left: 2px solid rgba(90, 54, 150, 0.20);
}

.summary-icon-dilution { color: #5a3696; }

.mix-wrap {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.recipe-card {
  border: 1px solid var(--recipe-card-border);
  border-radius: 15px;
  background: var(--recipe-card-bg);
  box-shadow: var(--recipe-card-shadow);
  padding: 11px 13px;
  min-width: 0;
}

.recipe-card-header {
  display: grid;
  gap: 4px;
  padding: 9px 7px 11px;
  border-bottom: 1px solid rgba(73, 109, 145, 0.28);
}

.recipe-card-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recipe-card-title-id {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Panel identity badges — reinforce which panel the user is in */
.panel-id-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
}

.panel-id-badge--recipe {
  background: rgba(46, 110, 180, 0.12);
  color: #2362a0;
  border: 1px solid rgba(46, 110, 180, 0.22);
}

.recipe-card-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  letter-spacing: 0;
  font-weight: 750;
  color: #173958;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.recipe-download-btn {
  margin-inline-start: auto;
  min-height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(73, 109, 145, 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(242, 248, 255, 0.95));
  color: #335779;
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, box-shadow 0.25s ease, background-color 0.18s ease, color 0.18s ease;
}

.recipe-download-btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recipe-download-btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.recipe-download-btn-text {
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .recipe-download-btn:hover {
    border-color: rgba(63, 106, 146, 0.44);
    box-shadow: 0 6px 14px rgba(23, 49, 75, 0.10);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(236, 245, 255, 0.98));
  }
}

.recipe-download-btn:active {
  transition: box-shadow 0s;
  box-shadow: inset 0 0 0 9999px rgba(80, 118, 168, 0.1);
  background: rgba(241, 247, 254, 0.98);
}

.recipe-download-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(69, 125, 178, 0.22);
}

.recipe-download-btn.is-loading {
  cursor: wait;
  box-shadow: 0 0 0 3px rgba(69, 125, 178, 0.14);
}

.recipe-download-btn.is-loading .recipe-download-btn-icon {
  animation: status-spin 0.9s linear infinite;
}

.recipe-download-btn:disabled {
  cursor: not-allowed;
  color: #9eaec0;
  border-color: rgba(138, 155, 175, 0.26);
  box-shadow: none;
  background: rgba(245, 248, 252, 0.92);
}

.recipe-download-btn.is-saved {
  color: #1f6a43;
  border-color: rgba(45, 133, 86, 0.36);
  background: linear-gradient(180deg, rgba(246, 255, 250, 0.99), rgba(232, 248, 239, 0.95));
}

.sd-recipe-actions-field {
  margin-top: -4px;
}

.sd-recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.sd-recipe-action-btn {
  margin-inline-start: 0;
}

.sd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 18, 32, 0.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sd-modal {
  width: min(460px, calc(100vw - 24px));
  border-radius: 22px;
  border: 1px solid rgba(84, 117, 152, 0.22);
  background: linear-gradient(180deg, rgba(254, 255, 255, 0.98), rgba(241, 247, 252, 0.98));
  box-shadow: 0 24px 60px rgba(13, 20, 35, 0.22);
  padding: 18px 18px 16px;
}

.sd-modal-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sd-modal-topbar h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  color: #173958;
}

.sd-modal-topbar button {
  appearance: none;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(49, 88, 131, 0.08);
  color: #3c5d82;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.sd-modal-hint {
  margin: 0 0 14px;
  color: #5b7087;
  font-size: 13px;
  line-height: 1.45;
}

.sd-modal-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sd-modal-label {
  font-size: 12px;
  font-weight: 700;
  color: #27496c;
}

.sd-modal-field input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(87, 115, 144, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: #173958;
  padding: 0 14px;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sd-modal-field input:focus-visible {
  outline: none;
  border-color: rgba(51, 111, 170, 0.44);
  box-shadow: 0 0 0 3px rgba(56, 116, 176, 0.18);
}

.sd-modal-charcount {
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  color: #6a7d93;
}

.sd-modal-error {
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(173, 36, 36, 0.08);
  color: #9b2323;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.sd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.sd-modal-actions button {
  appearance: none;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

#btnSaveRecipeCancel {
  border: 1px solid rgba(155, 42, 42, 0.28);
  background: rgba(255, 255, 255, 0.84);
  color: #ab3434;
}

#btnSaveRecipeCancel:hover {
  background: rgba(171, 52, 52, 0.08);
}

#btnSaveRecipeConfirm {
  border: 1px solid #2e6eb4;
  background: linear-gradient(180deg, #2e6eb4, #255b96);
  color: #fff;
}

#btnSaveRecipeConfirm:hover:not(:disabled) {
  background: #255b96;
  border-color: #255b96;
}

#btnSaveRecipeConfirm:disabled {
  opacity: 0.55;
}

.sd-recipes-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9635;
  background: rgba(10, 18, 32, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sd-recipes-panel-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sd-recipes-panel {
  position: fixed;
  z-index: 9650;
  top: max(84px, env(safe-area-inset-top));
  right: 16px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(72vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  border: 1px solid rgba(80, 113, 148, 0.22);
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.98), rgba(241, 247, 252, 0.98));
  box-shadow: 0 20px 56px rgba(15, 24, 38, 0.22);
  padding: 16px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(20px, 0, 0) scale(0.98);
  transition: transform 0.24s ease, opacity 0.22s ease;
}

.sd-recipes-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.sd-recipes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sd-recipes-panel-header h3 {
  margin: 0;
  color: #173958;
  font-size: 18px;
}

.sd-recipes-panel-header button {
  appearance: none;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(49, 88, 131, 0.08);
  color: #3c5d82;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.sd-recipes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  min-height: 0;
}

.sd-recipes-empty {
  border-radius: 16px;
  border: 1px dashed rgba(91, 117, 146, 0.26);
  background: rgba(255, 255, 255, 0.58);
  color: #5d7087;
  padding: 14px 15px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.sd-recipe-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  border: 1px solid rgba(95, 122, 151, 0.18);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.sd-recipe-item.is-active {
  border-color: rgba(50, 111, 170, 0.34);
  box-shadow: 0 10px 24px rgba(35, 76, 118, 0.1);
}

.sd-recipe-item.is-busy {
  opacity: 0.72;
}

.sd-recipe-item.is-skeleton {
  pointer-events: none;
}

.sd-recipe-item-body {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  min-width: 0;
  cursor: pointer;
  text-align: left;
}

.sd-recipe-item-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.sd-recipe-item-name {
  font-size: 14px;
  font-weight: 800;
  color: #183756;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-recipe-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sd-recipe-item-date {
  color: #687c91;
  font-size: 11px;
  font-variant-numeric: tabular-nums lining-nums;
}

.sd-recipe-item-badge {
  border-radius: 999px;
  background: rgba(38, 112, 78, 0.1);
  color: #206948;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sd-recipe-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sd-recipe-item-action {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(84, 112, 141, 0.18);
  background: rgba(247, 250, 253, 0.96);
  color: #335779;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sd-recipe-item-action svg {
  width: 17px;
  height: 17px;
}

.sd-recipe-item-load:hover {
  background: rgba(44, 108, 170, 0.08);
  border-color: rgba(44, 108, 170, 0.28);
}

.sd-recipe-item-archive:hover {
  background: rgba(165, 49, 49, 0.08);
  border-color: rgba(165, 49, 49, 0.26);
  color: #a33a3a;
}

.sd-recipe-skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(183, 199, 216, 0.24);
}

.sd-recipe-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: sd-recipe-skeleton-sheen 1.05s ease-in-out infinite;
}

.sd-recipe-skeleton-name {
  width: min(72%, 220px);
  height: 14px;
}

.sd-recipe-skeleton-meta {
  width: min(48%, 132px);
  height: 10px;
}

.sd-recipe-skeleton-action {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.sd-recipes-quota {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.sd-recipes-quota > span {
  color: #516579;
  font-size: 12px;
  font-weight: 700;
}

.sd-recipes-quota-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(106, 128, 150, 0.14);
}

.sd-recipes-quota-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f83c8, #66b0dd);
  transition: width 0.22s ease;
}

.sd-recipes-quota.is-warning .sd-recipes-quota-fill {
  background: linear-gradient(90deg, #d89423, #edb54f);
}

.sd-recipes-quota.is-danger .sd-recipes-quota-fill {
  background: linear-gradient(90deg, #b64242, #dc6666);
}

@media (max-width: 991px) {
  .sd-recipes-panel-backdrop {
    background: rgba(10, 18, 32, 0.28);
  }

  .sd-recipes-panel {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(68vh, 620px);
    border-radius: 24px 24px 18px 18px;
    transform: translate3d(0, calc(100% + 20px), 0);
  }

  .sd-recipes-panel.is-open {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-modal-backdrop,
  .sd-recipes-panel-backdrop,
  .sd-recipes-panel,
  .sd-recipes-quota-fill,
  .sd-recipe-skeleton::after {
    transition: none;
    animation: none;
  }
}

@keyframes sd-recipe-skeleton-sheen {
  100% {
    transform: translateX(100%);
  }
}

.recipe-title-meta {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  color: #5f7388;
  letter-spacing: 0;
  line-height: 1.35;
  font-variant-numeric: tabular-nums lining-nums;
}

.recipe-subtitle {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: #566b80;
  letter-spacing: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.recipe-download-message {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #5c7288;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.recipe-download-message.is-info {
  color: #4f6983;
}

.recipe-download-message.is-error {
  color: #a23e4c;
}

.recipe-subtitle-key {
  display: inline;
  color: #445d76;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.recipe-subtitle-value {
  color: #334a62;
  font-size: var(--text-xs);
  font-weight: 500;
  margin-left: 0;
  overflow-wrap: anywhere;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.recipe-row {
  border: 1px solid var(--recipe-row-border);
  border-radius: 10px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: space-between;
  min-height: 0;
  background: var(--recipe-row-bg);
  box-shadow: var(--recipe-row-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.recipe-row-head {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.recipe-logo-frame {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.recipe-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .recipe-row:hover {
    border-color: var(--recipe-row-hover-border);
    box-shadow: var(--recipe-row-hover-shadow);
    transform: translateY(-2px);
  }
}

.recipe-row:last-child {
  margin-bottom: 0;
}

.recipe-row .title {
  font-weight: 650;
  font-size: var(--text-xs);
  color: #1b3349;
  line-height: 1.35;
  overflow-wrap: anywhere;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-row .meta {
  font-size: var(--text-xs);
  font-weight: 750;
  color: var(--recipe-value-text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--recipe-value-border);
  background: var(--recipe-value-bg);
  justify-self: start;
  align-self: end;
}

.recipe-pro-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 15px;
  padding: 13px 14px;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(248, 244, 255, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 20px rgba(26, 20, 44, 0.08);
}

.recipe-pro-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.recipe-pro-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-pro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(118, 68, 187, 0.12);
  color: #5f31a7;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.recipe-pro-head h4 {
  margin: 0;
  color: #2b3b54;
  font-size: var(--text-md);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.recipe-pro-text {
  margin: 0;
  color: #617186;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
}

.recipe-pro-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(74, 111, 154, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(235, 244, 252, 0.96));
  color: #284d71;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(22, 45, 69, 0.1);
  transition: transform 0.18s ease, box-shadow 0.24s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.recipe-pro-link:hover {
  border-color: rgba(61, 102, 145, 0.36);
  background: linear-gradient(180deg, rgba(250, 253, 255, 1), rgba(236, 246, 255, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 18px rgba(22, 45, 69, 0.13);
  transform: translateY(-1px);
}

.recipe-pro-link:active {
  transform: translateY(0);
}

.recipe-pro-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(94, 145, 194, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 18px rgba(22, 45, 69, 0.13);
}

.floating-utility-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 40;
  width: min(760px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.floating-utility-dock > * {
  flex: 0 0 auto;
  margin: 0;
  pointer-events: auto;
}

.pro-floating-cta-wrap {
  position: static;
  width: auto;
  max-width: none;
  display: flex;
  justify-content: center;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.pro-floating-cta-wrap.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.pro-floating-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 13px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background-color: rgba(242, 236, 248, 0.78);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.09) 38%, rgba(255, 255, 255, 0.03) 100%),
    linear-gradient(180deg, rgba(240, 235, 248, 0.38), rgba(227, 232, 243, 0.2) 100%);
  color: #4a5f72;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(116, 112, 153, 0.07),
    0 7px 14px rgba(16, 8, 38, 0.06),
    0 11px 18px rgba(16, 8, 38, 0.05);
  backdrop-filter: blur(10px) saturate(1.01);
  -webkit-backdrop-filter: blur(10px) saturate(1.01);
  transition: transform 0.2s ease, box-shadow 0.24s ease, opacity 0.22s ease, border-color 0.18s ease;
  pointer-events: auto;
  overflow: hidden;
  opacity: 0.9;
}

.pro-floating-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 14% 50%, rgba(151, 96, 224, 0.045), transparent 22%),
    radial-gradient(circle at 84% 46%, rgba(101, 158, 207, 0.035), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.pro-floating-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(116, 112, 153, 0.08),
    0 8px 15px rgba(16, 8, 38, 0.07),
    0 13px 20px rgba(16, 8, 38, 0.06);
  opacity: 0.97;
}

.pro-floating-cta:active {
  transform: translateY(0);
}

.pro-floating-cta:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(179, 157, 224, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(116, 112, 153, 0.08),
    0 14px 22px rgba(16, 8, 38, 0.07);
}

.pro-floating-cta-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 33px;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, rgba(173, 128, 231, 0.085), rgba(130, 174, 214, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -1px 0 rgba(109, 84, 156, 0.04);
  color: #8165b3;
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.045em;
}

#floatingProCtaText {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 640;
  letter-spacing: 0.001em;
  color: #506476;
  white-space: nowrap;
}

body.member-modal-open .pro-floating-cta-wrap {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

html[dir="rtl"] .recipe-pro-head {
  flex-direction: row-reverse;
}

html[dir="rtl"] .recipe-pro-head h4,
html[dir="rtl"] .recipe-pro-text {
  text-align: right;
}

html[dir="rtl"] .pro-floating-cta-wrap {
  justify-content: flex-start;
}

.request-error {
  width: 100%;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(170, 26, 55, 0.35);
  background: rgba(255, 239, 242, 0.93);
  color: #8b1530;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(139, 21, 48, 0.12);
}

.hidden {
  display: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes status-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  :root {
    --hero-control-height: 34px;
    --hero-control-padding-x: 11px;
  }

  body {
    padding:
      max(12px, env(safe-area-inset-top))
      clamp(10px, 4vw, 16px)
      max(120px, calc(env(safe-area-inset-bottom) + 100px));
  }

  body::after {
    background: radial-gradient(ellipse 78% 54% at 50% 8%, rgba(193, 53, 132, 0.16) 0%, transparent 72%);
    opacity: 0.72;
  }

  .bg-shape {
    display: none;
  }

  .shell {
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    gap: 10px;
  }

  .hero-top,
  .hero-trust,
  .panel,
  .input-panel,
  .result-panel,
  .pull-refresh,
  .site-footer-shell {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .input-panel {
    gap: 12px;
    padding: clamp(13px, 3vw, 18px);
  }

  /* phase-field::before connector removed — see main rule */

  .hero-trust {
    max-width: 100%;
  }

  .member-modal {
    padding: 12px;
  }

  .member-modal-card {
    border-radius: 14px;
    padding: 14px;
  }

  .member-grid {
    grid-template-columns: 1fr;
  }

  .custom-select-panel {
    top: calc(100% + 8px);
  }

  .animated-select.open .custom-select-panel {
    max-height: min(260px, 44vh);
  }

  .plant-field .animated-select .custom-option,
  .phase-field .animated-select .custom-option {
    padding: 9px 12px;
  }

  .panel {
    border-radius: var(--panel-radius-mobile);
    padding: clamp(11px, 2.8vw, 14px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.62),
      0 5px 14px rgba(14, 6, 24, 0.12),
      0 14px 30px rgba(14, 6, 24, 0.14);
  }

  .calculate-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 13px;
    font-size: var(--text-xs);
  }

  .loading-overlay {
    padding: 16px;
  }

  .loading-overlay-card {
    width: fit-content;
    min-width: 204px;
    max-width: calc(100vw - 20px);
    min-height: 68px;
    padding: 12px 13px;
    gap: 10px;
  }

  .summary-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
    gap: 6px;
  }
  /* Override 4-col :has() rule at narrow widths */
  .summary-card:has(.summary-item-dilution:not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-tabs {
    width: 100%;
  }

  .recipe-card-header {
    gap: 3px;
  }

  .recipe-list {
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 9px;
  }

  .recipe-pro-card {
    align-items: flex-start;
  }

  .pro-floating-cta-wrap {
    width: min(760px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }

  .pro-floating-cta {
    min-height: 43px;
    padding: 0 13px 0 10px;
  }

  .report-section {
    padding: 10px;
    gap: 9px;
  }

  .report-element-grid {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 6px;
  }

}

@media (max-width: 520px) {
  :root {
    --hero-control-height: 33px;
    --hero-control-padding-x: 10px;
  }

  .panel {
    border-radius: 12px;
    padding: 10px 11px;
  }

  body {
    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(14px, env(safe-area-inset-bottom));
  }

  .plant-field,
  .phase-field {
    padding: 8px;
    border-radius: 15px;
  }

  .input-panel {
    gap: 10px;
    padding: 12px;
  }

  /* phase-field::before connector removed — see main rule */

  .hero-trust {
    padding: 7px 10px;
    border-radius: 16px;
    gap: 8px;
  }

  html[dir="rtl"] .hero-trust {
    padding: 7px 10px;
  }

  .hero-trust-mark {
    width: 34px;
    height: 30px;
    flex-basis: 34px;
    border-radius: 11px;
  }

  .hero-trust-logo {
    width: 20px;
    height: 20px;
  }

  .hero-trust-title {
    font-size: calc(var(--text-2xs) * 0.88);
  }

  .hero-trust-text {
    font-size: calc(var(--text-2xs) * 0.93);
  }

  .hero-trust-install {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    min-height: 30px;
    padding: 5px 10px;
    font-size: calc(var(--text-2xs) * 0.9);
  }

  .hero-trust-notice {
    padding: 7px 9px;
    font-size: calc(var(--text-2xs) * 0.9);
  }

  .member-modal {
    padding: 10px;
  }

  .member-modal-card {
    width: calc(100vw - 18px);
    border-radius: 12px;
    padding: 12px;
  }

  .member-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .member-register-btn,
  .member-secondary-btn,
  .member-forget-btn {
    width: 100%;
    justify-content: center;
  }

  .plant-field .animated-select .custom-select-trigger,
  .phase-field .animated-select .custom-select-trigger {
    min-height: 54px;
    padding: 10px 38px 10px 10px;
    gap: 8px;
  }

  .custom-select-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .custom-select-icon svg {
    width: 16px;
    height: 16px;
  }

  .plant-field .animated-select .custom-select-trigger::after,
  .phase-field .animated-select .custom-select-trigger::after {
    top: 4px;
    left: 50px;
    font-size: 0.66rem;
  }

  .plant-field .animated-select .custom-select-trigger::before,
  .phase-field .animated-select .custom-select-trigger::before {
    right: 12px;
    width: 7px;
    height: 7px;
  }

  .custom-select-trigger {
    min-height: 46px;
    padding: 9px 11px;
    font-size: 0.93rem;
  }

  .custom-select-panel {
    top: calc(100% + 8px);
  }

  .custom-option {
    font-size: 0.88rem;
    padding: 9px 11px;
  }

  /* Plant/phase dropdown: bigger touch targets on mobile */
  .plant-field .animated-select .custom-option,
  .phase-field .animated-select .custom-option {
    padding: 14px 14px;
    min-height: 48px;
    font-size: var(--text-sm);
  }
  .plant-field .animated-select .custom-option:hover,
  .phase-field .animated-select .custom-option:hover {
    padding-left: 18px;
  }
  .plant-field .animated-select .custom-option.active,
  .phase-field .animated-select .custom-option.active {
    padding-left: 18px;
  }

  .calculate-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 0.86rem;
  }

  .loading-overlay {
    padding: 12px;
  }

  .loading-overlay-card {
    width: fit-content;
    min-width: 196px;
    max-width: calc(100vw - 18px);
    min-height: 64px;
    border-radius: 12px;
    padding: 11px 12px;
    gap: 9px;
  }

  .loading-spinner {
    width: 16px;
    height: 16px;
  }

  .loading-overlay-text {
    font-size: 0.86rem;
  }

  .summary-card {
    padding: 5px;
    gap: 5px;
  }

  .result-tab {
    padding: 8px 10px;
    font-size: var(--text-xs);
    gap: 5px;
  }

  .result-tab-icon {
    width: 17px;
    height: 17px;
  }

  .result-tab-sublabel {
    font-size: 9px;
  }

  .summary-item {
    padding: 5px 7px;
  }

  .summary-item-adjustable {
    padding: 0;
  }

  .summary-item-dose h2 {
    font-size: var(--text-xs);
  }

  .recipe-card {
    padding: 9px 10px;
  }

  .recipe-list {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 7px;
  }

  .custom-select-footer {
    padding: 8px;
  }

  .recipe-pro-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .recipe-pro-link {
    width: 100%;
  }

  .pro-floating-cta-wrap {
    width: auto;
    max-width: calc(100vw - 32px);
  }

  .pro-floating-cta {
    gap: 7px;
    min-height: 50px;
    padding: 0 13px 0 10px;
  }

  .pro-floating-cta-badge {
    min-width: 33px;
    min-height: 25px;
    padding: 0 7px;
    font-size: 0.61rem;
  }

  #floatingProCtaText {
    font-size: 0.82rem;
  }

  .report-section-head h3 {
    font-size: var(--text-md);
  }

  .report-element-grid {
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  }

  .report-element-card {
    min-height: 0;
    padding: 7px 8px;
  }

  .recipe-row {
    padding: 7px 8px;
    gap: 5px;
  }

  .recipe-logo-frame {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 7px;
  }

  .recipe-logo {
    width: 20px;
    height: 20px;
  }

  .hero {
    padding: 8px 0 6px;
    max-width: 100%;
  }

}

@media (max-width: 360px) {
  .summary-item-adjustable {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .summary-stepper-btn {
    font-size: 1.08rem;
  }

  .recipe-list {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 6px;
  }

  .calculate-btn {
    min-height: 44px;
    font-size: 0.82rem;
  }

  .recipe-card-header {
    gap: 3px;
  }

  .report-element-grid {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 6px;
  }

  .report-status-chip {
    font-size: var(--text-2xs);
    padding: 3px 7px;
  }

  .recipe-logo-frame {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    border-radius: 6px;
  }

  .recipe-logo {
    width: 18px;
    height: 18px;
  }

}

@media (hover: none) and (pointer: coarse) and (min-width: 761px) {
  /* ≤760px ekranlarda blur zaten tamamen kapatılıyor.
     Burada sadece daha geniş dokunmatik cihazlarda blur'u düşürüyoruz. */
  .hero-top {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .input-panel {
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
  }

  .panel {
    backdrop-filter: blur(8px) saturate(1.06);
    -webkit-backdrop-filter: blur(8px) saturate(1.06);
  }

  .site-footer-shell {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* Sticky header kendi compositor katmanına alınsın */
  .hero-top {
    will-change: transform;
  }
}



/* ── Footer & Social Links ─────────────────────────── */
.site-footer {
  position: static;
  z-index: 12;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  transform: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.7s;
  pointer-events: none;
}

.site-footer.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.site-footer-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 50px;
  min-width: 54px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background-color: rgba(239, 232, 247, 0.76);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.03) 100%),
    linear-gradient(180deg, rgba(239, 231, 248, 0.32), rgba(222, 226, 240, 0.18) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -1px 0 rgba(116, 112, 153, 0.08),
    0 10px 20px rgba(16, 8, 38, 0.09),
    0 16px 24px rgba(16, 8, 38, 0.06);
  backdrop-filter: blur(11px) saturate(1.02);
  -webkit-backdrop-filter: blur(11px) saturate(1.02);
  overflow: visible;
  pointer-events: auto;
  transition: box-shadow 0.24s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.site-footer-shell::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 14px;
  width: min(96px, calc(100% - 28px));
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.site-footer-shell.is-expanded {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -1px 0 rgba(116, 112, 153, 0.08),
    0 10px 22px rgba(16, 8, 38, 0.1),
    0 16px 26px rgba(16, 8, 38, 0.07);
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 7px;
  margin-inline-start: 0;
  max-width: 320px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  transition:
    max-width 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease,
    transform 0.18s ease,
    margin 0.22s ease;
}

.site-footer-shell.is-expanded .social-links {
  margin-inline-start: 8px;
}

.social-links.is-collapsed {
  max-width: 0;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
}

.social-toggle,
.social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(70, 84, 104, 0.88);
  background-color: rgba(246, 242, 250, 0.78);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    linear-gradient(180deg, rgba(243, 238, 250, 0.26), rgba(233, 237, 245, 0.12));
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(112, 116, 152, 0.05);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.35s ease;
}

.social-toggle {
  cursor: pointer;
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 50%;
  color: rgba(74, 95, 114, 0.94);
  appearance: none;
  -webkit-appearance: none;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.social-toggle svg,
.social-link svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.social-toggle:hover,
.social-link:hover {
  color: rgba(52, 69, 89, 0.98);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 0%, rgba(201, 182, 239, 0.18), transparent 70%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 16px rgba(17, 5, 29, 0.12);
  transform: translateY(-1px);
}

.social-toggle:active,
.social-link:active {
  transform: translateY(-1px);
  transition: box-shadow 0s, transform 0.18s ease;
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.1);
}

.social-toggle:focus-visible,
.social-link:focus-visible {
  outline: 2px solid rgba(140, 100, 210, 0.6);
  outline-offset: 2px;
  box-shadow:
    0 0 0 4px rgba(140, 100, 210, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.social-toggle.is-active {
  color: rgba(55, 78, 103, 0.98);
  border-color: rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 50% 0%, rgba(181, 210, 233, 0.2), transparent 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 16px rgba(17, 5, 29, 0.1);
}

.social-toggle.is-active svg {
  transform: scale(0.98);
  transition: transform 0.18s ease;
}

.social-link {
  flex: 0 0 auto;
}

.social-toggle {
  flex: 0 0 auto;
}

.social-toggle svg {
  stroke: currentColor;
}

.social-link svg {
  stroke: none;
}

@media (max-width: 640px) {
  .floating-utility-dock {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 6px));
  }

  .site-footer-shell {
    min-width: 50px;
    padding: 7px;
  }

  .social-links {
    gap: 6px;
  }

  .social-toggle,
  .social-link {
    height: 36px;
  }

  .social-toggle {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .social-link {
    width: 36px;
  }

  .social-toggle svg,
  .social-link svg {
    width: 17px;
    height: 17px;
  }

  .pro-floating-cta-wrap,
  .site-footer {
    justify-content: center;
  }

}

/* ── Fertilizer Edit Button (bottom of selection panel) ── */
.fert-edit-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid rgba(90, 110, 140, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(240, 244, 252, 0.40));
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #4a6a8a;
  transition: background 0.15s ease, color 0.15s ease;
}
.fert-edit-trigger:hover {
  background: linear-gradient(180deg, rgba(46, 110, 180, 0.08), rgba(46, 110, 180, 0.14));
  color: #2a5a8a;
}
.fert-edit-trigger-icon {
  font-size: 14px;
  line-height: 1;
}
@media (max-width: 360px) {
  .fert-edit-trigger {
    padding: 8px 10px;
    font-size: 11px;
  }
  .fert-edit-trigger-icon {
    font-size: 12px;
  }
}

/* ── Fertilizer Editor Overlay ── */
.fert-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fert-editor-overlay.hidden {
  display: none;
}

.fert-editor-panel {
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 8, 30, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fert-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.12);
}
.fert-editor-title {
  font-size: 16px;
  font-weight: 700;
  color: #2a3a4c;
  margin: 0;
}
.fert-editor-close {
  appearance: none;
  border: none;
  background: none;
  font-size: 22px;
  color: #6a7a8a;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fert-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.08);
}
.fert-editor-search {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(90, 110, 140, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  padding: 8px 12px;
  font-size: 13px;
  color: #2a3a4a;
  outline: none;
}
.fert-editor-search:focus {
  border-color: #5a7a9c;
  background: rgba(255, 255, 255, 0.92);
}
.fert-editor-add-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(46, 140, 80, 0.3);
  background: rgba(46, 140, 80, 0.08);
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #2a8c50;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.fert-editor-add-btn:hover {
  background: rgba(46, 140, 80, 0.16);
}

.fert-editor-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 12px;
  min-height: 120px;
}
.fert-editor-body::-webkit-scrollbar { width: 4px; }
.fert-editor-body::-webkit-scrollbar-track { background: transparent; }
.fert-editor-body::-webkit-scrollbar-thumb { background: rgba(90, 110, 140, 0.25); border-radius: 2px; }

/* ── Editor: fertilizer card ── */
.fert-ed-card {
  border: 1px solid rgba(86, 112, 138, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.88));
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.fert-ed-card.is-hidden { display: none; }
.fert-ed-card.is-dirty { border-color: rgba(180, 140, 20, 0.4); }
.fert-ed-card.is-new { border-color: rgba(46, 140, 80, 0.35); }

.fert-ed-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.fert-ed-card-header:hover { background: rgba(90, 122, 156, 0.05); }

.fert-ed-card-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.fert-ed-card-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #2a3a4c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fert-ed-card-delete {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  color: #c0392b;
  font-size: 15px;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fert-ed-card-delete:hover { opacity: 1; }

.fert-ed-card-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(90, 110, 140, 0.5);
  border-bottom: 2px solid rgba(90, 110, 140, 0.5);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.fert-ed-card.is-expanded .fert-ed-card-chevron {
  transform: rotate(-135deg);
}

.fert-ed-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.fert-ed-card.is-expanded .fert-ed-card-body {
  max-height: 2000px;
}

.fert-ed-card-fields {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(90, 110, 140, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section title */
.fert-ed-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #8a9aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.10);
}

/* Top row: name (grows) + form toggle (shrinks) */
.fert-ed-top-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.fert-ed-top-row .fert-ed-meta-field { flex: 1; min-width: 0; }
.fert-ed-meta-field {
  flex: 1;
  min-width: 0;
}
.fert-ed-meta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #8a9aaa;
  margin-bottom: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fert-ed-meta-input {
  width: 100%;
  border: 1px solid rgba(90, 110, 140, 0.18);
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #2a3a4a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fert-ed-meta-input:focus {
  border-color: #2e6eb4;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.10);
}

/* Compound grid — mini cards, vertical layout */
.fert-ed-compounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 5px;
}
.fert-ed-compound-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 7px 5px;
  border: 1px solid rgba(90, 110, 140, 0.12);
  border-radius: 8px;
  background: rgba(248, 250, 253, 0.7);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fert-ed-compound-cell:hover {
  border-color: rgba(90, 110, 140, 0.22);
  background: rgba(248, 250, 253, 1);
}
.fert-ed-compound-cell.has-value {
  border-color: rgba(46, 110, 180, 0.28);
  background: rgba(124, 58, 237, 0.05);
}
.fert-ed-compound-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #7a8a9a;
  line-height: 1.3;
  word-break: break-word;
  white-space: normal;
  min-height: 22px;
  display: flex;
  align-items: flex-start;
}
.fert-ed-compound-cell.has-value .fert-ed-compound-label {
  color: #2e6eb4;
}
.fert-ed-compound-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid rgba(90, 110, 140, 0.14);
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.fert-ed-compound-input-wrap:focus-within {
  border-color: #2e6eb4;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.10);
}
.fert-ed-compound-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 3px 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: #2a3a4a;
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.fert-ed-compound-unit {
  padding: 0 4px 0 0;
  font-size: 9.5px;
  font-weight: 700;
  color: #9aaabb;
  flex-shrink: 0;
  user-select: none;
}

/* ── Editor Footer ── */
.fert-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(245, 248, 252, 0.95);
}
.fert-editor-footer-right {
  display: flex;
}
.fert-editor-footer-right > .fert-editor-save-btn {
  margin-left: 8px;
}
.fert-editor-reset-btn,
.fert-sel-reset-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8a4820;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  align-self: center;
}
.fert-editor-reset-btn:hover,
.fert-sel-reset-btn:hover { opacity: 1; text-decoration: underline; }
.fert-editor-reset-btn:active,
.fert-sel-reset-btn:active {
  opacity: 0.9;
}
.fert-editor-cancel-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #4a6a8a;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease;
}
.fert-editor-cancel-btn:hover { background: rgba(90, 122, 156, 0.12); }
.fert-editor-save-btn {
  appearance: none;
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  cursor: pointer;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fert-editor-save-btn:hover { background: #245a96; border-color: #245a96; }

/* ── New fertilizer inline form ── */
.fert-ed-new-form {
  padding: 10px 12px;
  border: 1px dashed rgba(46, 140, 80, 0.3);
  border-radius: 12px;
  background: rgba(46, 140, 80, 0.04);
  margin-bottom: 6px;
}
.fert-ed-new-form .fert-ed-meta-row { margin-bottom: 6px; }

@media (max-width: 480px) {
  .fert-editor-panel { max-width: 100%; border-radius: 16px; }
  .fert-ed-compounds-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .fert-editor-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ── Fert Editor: Physical Form Section ── */
.fert-ed-form-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fert-ed-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fert-ed-form-toggle {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(90, 110, 140, 0.18);
}
.fert-ed-form-btn {
  padding: 5px 14px;
  border: none;
  background: rgba(240, 244, 252, 0.5);
  color: #6a7a8a;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.fert-ed-form-btn:first-child { border-right: 1px solid rgba(90, 110, 140, 0.12); }
.fert-ed-form-btn.is-active {
  background: linear-gradient(180deg, #2e6eb4 0%, #245a96 100%);
  color: #fff;
}
.fert-ed-form-btn:not(.is-active):hover {
  background: rgba(46, 110, 180, 0.08);
}
.fert-ed-density-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fert-ed-density-input {
  width: 72px;
  padding: 4px 6px;
  border: 1px solid rgba(90, 110, 140, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  color: #2a3a4a;
  text-align: center;
  transition: border-color 0.15s ease;
}
.fert-ed-density-input:focus {
  outline: none;
  border-color: rgba(46, 110, 180, 0.45);
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.08);
}
.fert-ed-density-unit {
  font-size: 11px;
  color: #7a8a9a;
  white-space: nowrap;
}

/* ── Liquid Fertilizer Badge ── */
.fert-liquid-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(46, 140, 200, 0.12), rgba(46, 160, 220, 0.18));
  color: #2a7ab0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.6;
}
.fert-liquid-badge.small {
  font-size: 9px;
  padding: 0px 5px;
  margin-left: 4px;
}

/* ── Trigger Row (Fert Editor + Stock Editor buttons) ── */
.fert-trigger-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.fert-trigger-row .fert-edit-trigger {
  flex: 1;
  border-top: none;
}
.fert-trigger-row .fert-edit-trigger + .fert-edit-trigger {
  border-left: 1px solid rgba(90, 110, 140, 0.12);
}
.stock-edit-trigger {
  color: #5a7a5a;
}
.stock-edit-trigger:hover {
  background: linear-gradient(180deg, rgba(46, 140, 80, 0.06), rgba(46, 140, 80, 0.12));
  color: #3a6a3a;
}

/* ── Stock Editor Overlay ── */
.stock-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.stock-editor-overlay.hidden {
  display: none;
}
.stock-editor-panel {
  width: 100%;
  max-width: 520px;
  height: min(620px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, #f8faff 0%, #f0f4fc 100%);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.stock-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.10);
}
.stock-editor-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a2a3a;
}
.stock-editor-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(90, 110, 140, 0.06);
  border-radius: 10px;
  font-size: 20px;
  color: #6a7a8a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.stock-editor-close:hover {
  background: rgba(180, 60, 60, 0.10);
  color: #a03030;
}
.stock-editor-close:focus-visible,
.stock-ed-tab:focus-visible,
.stock-ed-toggle-btn:focus-visible,
.stock-ed-send-btn:focus-visible,
.stock-ed-picker-tank-btn:focus-visible,
#stockEditorResetBtn:focus-visible,
#stockEditorCancelBtn:focus-visible,
#stockEditorSaveBtn:focus-visible {
  outline: 2px solid rgba(46, 110, 180, 0.32);
  outline-offset: 2px;
}
.stock-editor-hint {
  margin: 0;
  padding: 8px 20px 4px;
  font-size: 12px;
  color: #6a7a8a;
  line-height: 1.5;
}
.stock-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 12px;
  min-height: 0;
}
.stock-editor-body::-webkit-scrollbar { width: 4px; }
.stock-editor-body::-webkit-scrollbar-track { background: transparent; }
.stock-editor-body::-webkit-scrollbar-thumb { background: rgba(90, 110, 140, 0.25); border-radius: 2px; }

/* ── Stock Editor Tab Bar — raised-tab pattern ── */
.stock-ed-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 8px 16px 0;
  background: rgba(210, 218, 232, 0.28);
  border-bottom: 1.5px solid rgba(90, 110, 140, 0.14);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}
.stock-ed-tab-bar::-webkit-scrollbar { display: none; }

/* All tabs: flat, muted */
.stock-ed-tab {
  padding: 7px 13px 8px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #7a8a9a;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1.5px;       /* overlap the tab bar border */
  transition: background 0.15s ease, color 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.stock-ed-tab:hover {
  background: rgba(255, 255, 255, 0.55);
  color: #3a4a5c;
}

/* Active tab: raised — solid background, borders on 3 sides, connected to content */
.stock-ed-tab.is-active {
  background: #f6f9fd;          /* matches panel top-gradient */
  border-color: rgba(90, 110, 140, 0.16);
  color: #1e3048;
  font-weight: 700;             /* bold = shape cue for color-blind */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
  /* bottom transparent = merges with content area */
  border-bottom-color: #f6f9fd;
}

/* "Gübreler" tab has a subtle left marker when active */
.stock-ed-tab-list.is-active {
  color: #3a1a70;
  border-color: rgba(90, 60, 160, 0.20);
  border-bottom-color: #f6f9fd;
}
.stock-ed-tab-list:hover { color: #5a30a0; }

/* Count badge */
.stock-ed-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 15px;
  padding: 0 4px;
  border-radius: 7px;
  background: rgba(90, 110, 140, 0.12);
  color: #5a6a7a;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.stock-ed-tab.is-active .stock-ed-tab-badge {
  background: rgba(46, 110, 180, 0.15);
  color: #2e6eb4;
}

/* + add button */
.stock-ed-tab-add {
  padding: 5px 10px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 7px;
  margin-left: 2px;
  margin-bottom: 2px;           /* sits lower than tabs */
  color: #8a9aaa;
}
.stock-ed-tab-add:hover { background: rgba(46, 110, 180, 0.09); color: #2e6eb4; }

/* ── Stock Editor Toolbar (dynamic per tab) ── */
.stock-ed-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  flex-wrap: wrap;
  min-height: 40px;
}
.stock-ed-toolbar:empty { display: none; }
.stock-ed-toggle-btn {
  padding: 6px 14px;
  border: 1px solid rgba(90, 110, 140, 0.18);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #5a6a7a;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.stock-ed-toggle-btn:hover {
  background: rgba(46, 110, 180, 0.06);
  border-color: rgba(46, 110, 180, 0.25);
}
.stock-ed-toggle-btn.is-remove-all {
  border-color: rgba(180, 60, 40, 0.25);
  background: rgba(180, 60, 40, 0.06);
  color: #a03828;
}
.stock-ed-toggle-btn.is-remove-all:hover {
  background: rgba(180, 60, 40, 0.14);
  border-color: rgba(180, 60, 40, 0.4);
}
.stock-ed-toggle-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
/* "Gönder" button */
.stock-ed-send-btn {
  margin-left: auto;
  padding: 6px 16px;
  border: 1px solid #5a30a0;
  background: #5a30a0;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.stock-ed-send-btn:hover { background: #4a2590; border-color: #4a2590; }
.stock-ed-send-btn.is-disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── Tank picker popup ── */
.stock-ed-tank-picker {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 200;
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(12, 8, 30, 0.16);
  padding: 8px 6px;
  min-width: 140px;
}
.stock-ed-picker-label {
  font-size: 10px;
  font-weight: 700;
  color: #8a9aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 8px 6px;
  border-bottom: 1px solid rgba(90, 110, 140, 0.10);
  margin-bottom: 4px;
}
.stock-ed-picker-tank-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #2a3a4c;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.stock-ed-picker-tank-btn:hover {
  background: rgba(46, 110, 180, 0.08);
  color: #2e6eb4;
}

/* ── Tank card grid (tank tab view) ── */
.stock-ed-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  padding: 8px 14px 12px;
}
.stock-ed-tank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 8px;
  border: 1px solid rgba(46, 110, 180, 0.18);
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.05);
  text-align: center;
  min-height: 62px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.stock-ed-tank-card:hover {
  border-color: rgba(46, 110, 180, 0.28);
  background: rgba(46, 110, 180, 0.07);
}
.stock-ed-tank-card-name {
  font-size: 10.5px;
  font-weight: 600;
  color: #2a3a4c;
  line-height: 1.35;
  word-break: break-word;
  max-width: 100%;
}
.stock-ed-tank-card-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 5px;
  flex-shrink: 0;
}
.stock-ed-tank-card .fert-liquid-badge {
  margin-top: 3px;
}
.stock-ed-tank-card-remove {
  position: absolute;
  top: 3px; right: 4px;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #8a9aaa;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.12s ease, background 0.12s ease;
}
.stock-ed-tank-card-remove:hover { color: #b42e2e; background: rgba(180, 46, 46, 0.08); }

/* ── Tank tag (in list view, shows which tank) — compact, non-crushing ── */
.stock-ed-tank-tag {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(46, 110, 180, 0.12);
  color: #2e6eb4;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* ── Warning Queue ── */
.stock-ed-compat {
  padding: 0 16px 2px;
}
.stock-ed-compat:empty { display: none; }

.stock-ed-compat .warning-queue-stack {
  margin-top: 8px;
}

/* Stack wrapper — no absolute positioning, clean flow */
.warning-queue-stack {
  margin-bottom: 6px;
}

/* Warning trigger badge — removed from UI, card shows directly */

.warning-queue-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 110, 180, 0.16);
}

.warning-queue-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
}

.warning-queue-card {
  position: relative;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.warning-queue-card.risk-high {
  background: rgba(200, 60, 40, 0.07);
  border: 1px solid rgba(200, 60, 40, 0.22);
  color: #8a2a20;
}

.warning-queue-card.risk-medium {
  background: rgba(180, 130, 40, 0.07);
  border: 1px solid rgba(180, 130, 40, 0.22);
  color: #6a4a10;
}

.warning-queue-card.risk-low {
  background: rgba(46, 110, 180, 0.06);
  border: 1px solid rgba(46, 110, 180, 0.18);
  color: #1f4f86;
}

.warning-queue-card.risk-info {
  background: rgba(71, 85, 105, 0.06);
  border: 1px solid rgba(71, 85, 105, 0.16);
  color: #334155;
}

/* Top row: icon + counter + close */
.warning-queue-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.warning-queue-counter {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.55;
  letter-spacing: 0.04em;
  text-align: right;
  padding-right: 4px;
}

.warning-queue-close {
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.5;
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: opacity 0.12s ease, background 0.12s ease;
  color: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .warning-queue-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
  }
}

/* Body */
.warning-queue-body { min-width: 0; }

.warning-queue-rule {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.warning-queue-ferts {
  font-size: 10px;
  color: #6a7a8a;
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}

/* ── Stock Editor Rows (checkbox list) ── */
.stock-ed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(90, 110, 140, 0.08);
  margin-bottom: 5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.stock-ed-row:hover {
  border-color: rgba(90, 110, 140, 0.16);
}
.stock-ed-row.is-checked {
  background: rgba(46, 110, 180, 0.06);
  border-color: rgba(46, 110, 180, 0.20);
}
/* Assigned to a tank: dimmed, non-interactive (desktop app parity) */
.stock-ed-row.is-assigned {
  opacity: 0.42;
  pointer-events: none;
  cursor: default;
  background: transparent;
  border-color: rgba(90, 110, 140, 0.06);
}
.stock-ed-row.is-assigned .stock-ed-name {
  color: #8a9aaa;
}
.stock-ed-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 5px;
  flex-shrink: 0;
}
.stock-ed-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #2e6eb4;
  flex-shrink: 0;
  cursor: pointer;
}
.stock-ed-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: #2a3a4a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-ed-other-tank {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(180, 100, 40, 0.10);
  color: #8a5a30;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.stock-editor-empty {
  text-align: center;
  color: #8a9aaa;
  font-size: 12.5px;
  padding: 24px 0;
}

/* ── Stock Editor Footer ── */
.stock-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(90, 110, 140, 0.10);
  gap: 8px;
}
.stock-editor-footer-right {
  display: flex;
}
.stock-editor-footer-right > #stockEditorSaveBtn {
  margin-left: 8px;
}
#stockEditorResetBtn {
  appearance: none;
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8a4820;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  align-self: center;
}
#stockEditorResetBtn:hover { opacity: 1; text-decoration: underline; }
#stockEditorResetBtn:active {
  opacity: 0.9;
}
#stockEditorResetBtn:disabled {
  opacity: 0.35;
  cursor: default;
  text-decoration: none;
}
#stockEditorResetBtn[hidden] { display: none; }
#stockEditorCancelBtn {
  padding: 8px 16px;
  border: 1px solid rgba(90, 110, 140, 0.18);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #5a6a7a;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
#stockEditorCancelBtn:hover { background: rgba(90, 122, 156, 0.12); }
#stockEditorSaveBtn {
  padding: 8px 20px;
  border: 1px solid #2e6eb4;
  background: linear-gradient(180deg, #2e6eb4 0%, #245a96 100%);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
#stockEditorSaveBtn:hover { background: #245a96; border-color: #245a96; }

/* ── Stock Editor Mobile ── */
@media (max-width: 480px) {
  .stock-editor-panel { max-width: 100%; border-radius: 16px; }
  .stock-ed-tab { padding: 7px 12px; font-size: 11.5px; }
  .stock-ed-toolbar { flex-wrap: wrap; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .stock-editor-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(400px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 6px 20px rgba(12, 8, 30, 0.18);
  animation: toastIn 0.25s ease forwards;
  opacity: 0;
  transform: translateY(-12px);
}
.toast.is-success {
  background: #1a6a3a;
  color: #e8f5ee;
}
.toast.is-error {
  background: #8b2020;
  color: #fce8e8;
}
.toast.is-removing {
  animation: toastOut 0.2s ease forwards;
}
@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px); }
}

/* ── Confirm Dialog ── */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.confirm-dialog.hidden { display: none; }
.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 12, 32, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.confirm-dialog-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(12, 8, 30, 0.2);
  padding: 12px 20px 16px;
}
.confirm-dialog-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.confirm-dialog-close {
  appearance: none;
  border: none;
  background: rgba(108, 63, 181, 0.07);
  border-radius: 50%;
  font-size: 16px;
  color: #6c3fb5;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s ease;
}
.confirm-dialog-close:hover { background: rgba(108, 63, 181, 0.15); }
.confirm-dialog-message {
  font-size: 14px;
  font-weight: 500;
  color: #2a3a4c;
  line-height: 1.5;
  margin: 0 0 18px;
  text-align: center;
}
.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.confirm-dialog-btn {
  appearance: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
/* Uygulama geneli sözleşme: KABUL (onay) her zaman MAVİ, REDDET (iptal/
   vazgeç) her zaman KIRMIZI. Böylece kullanıcı hangi dialogda olursa
   olsun hangi butonun ne yaptığını renkten anında okuyabilir.
   — is-danger (OK) varyantı kaldırıldı: OK artık her durumda mavi.
   — is-danger-text (cancel) koşulu kaldırıldı: cancel her zaman
     kırmızı outline-style pill. */
.confirm-dialog-cancel,
.confirm-dialog-cancel.is-danger-text {
  border: 1px solid rgba(180, 46, 46, 0.38);
  background: rgba(255, 255, 255, 0.6);
  color: #b42e2e;
}
.confirm-dialog-cancel:hover,
.confirm-dialog-cancel.is-danger-text:hover {
  background: rgba(180, 46, 46, 0.10);
  border-color: rgba(180, 46, 46, 0.55);
}
.confirm-dialog-ok,
.confirm-dialog-ok.is-danger {
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  color: #fff;
}
.confirm-dialog-ok:hover,
.confirm-dialog-ok.is-danger:hover {
  background: #245a96;
  border-color: #245a96;
}

/* ══════════════════════════════════════════════════════════════════════
   Fine-tune card
   ══════════════════════════════════════════════════════════════════════ */
.fine-tune-card-field {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: var(--field-shell-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16));
  box-shadow: 0 2px 8px rgba(25, 20, 44, 0.04);
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s ease, border-color 0.2s ease;
}
.fine-tune-card-field.is-card-hidden {
  display: none;
}
.fine-tune-card-field.is-card-entering {
  opacity: 0;
  transform: translateY(8px);
}
.fine-tune-card-field.is-card-visible {
  opacity: 1;
  transform: translateY(0);
}
.fine-tune-card-field:hover {
  box-shadow: 0 4px 14px rgba(25, 20, 44, 0.08);
  border-color: rgba(46, 110, 180, 0.22);
}
.fine-tune-card-field:active {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.10));
}
.fine-tune-card-header {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  gap: 10px;
  user-select: none;
  position: relative;
}
.fine-tune-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(86, 52, 168, 0.08);
  color: #6c3fb5;
}
.fine-tune-card-icon svg { width: 18px; height: 18px; }
.fine-tune-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fine-tune-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #3a4a5c;
  letter-spacing: 0.04em;
}
.fine-tune-card-subtitle {
  font-size: 10.5px;
  color: #8a9aaa;
  font-weight: 500;
}
.fine-tune-card-arrow {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(64, 79, 102, 0.55);
  border-bottom: 2px solid rgba(64, 79, 102, 0.55);
  transform: rotate(-45deg);
  margin-left: 2px;
}

/* ��════════════════��════════════════════════════════════════════════════
   Fine-tune overlay
   ══════════��════════════════════════════��══════════════════════════════ */
.fine-tune-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(18, 12, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.fine-tune-overlay.hidden { display: none; }
.fine-tune-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.fine-tune-panel {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 8, 30, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.fine-tune-overlay.is-visible .fine-tune-panel {
  transform: translateY(0) scale(1);
}
@media (min-width: 640px) {
  .fine-tune-overlay { padding: 16px; }
}

/* Topbar — matching fert/plant overlay pattern */
.fine-tune-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #ede8f5 0%, #f2eef9 50%, #f8f5fc 100%);
  border-bottom: 1px solid rgba(108, 63, 181, 0.10);
  flex-shrink: 0;
}
.fine-tune-header-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(108, 63, 181, 0.10);
  color: #6c3fb5;
}
.fine-tune-header-icon svg { width: 18px; height: 18px; }
.fine-tune-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #2a3a4c;
  margin: 0;
  letter-spacing: 0.01em;
}
.fine-tune-close {
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: rgba(108, 63, 181, 0.07);
  border-radius: 50%;
  font-size: 18px;
  color: #6c3fb5;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .fine-tune-close:hover { background: rgba(108, 63, 181, 0.15); }
}

.fine-tune-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(108, 63, 181, 0.18);
}

.fine-tune-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 63, 181, 0.2) transparent;
}
.fine-tune-body::-webkit-scrollbar { width: 4px; }
.fine-tune-body::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(108, 63, 181, 0.2); }

/* Slider section */
.fine-tune-slider-section {
  padding: 12px 0 10px;
}
.fine-tune-slider-row {
  display: flex;
  align-items: center;
}
.fine-tune-slider {
  flex: 1;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(108, 63, 181, 0.12);
  border-radius: 3px;
  outline: none;
}
.fine-tune-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6c3fb5;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(108, 63, 181, 0.35);
  cursor: pointer;
}
.fine-tune-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6c3fb5;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(108, 63, 181, 0.35);
  cursor: pointer;
}

/* Phase labels row — opacity set inline by JS based on proximity */
.fine-tune-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  margin-top: 5px;
}
.fine-tune-slider-phase-label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  color: #6c3fb5;
  transition: opacity 0.18s ease, font-weight 0.1s ease, font-size 0.18s ease;
}

/* Summary bar */
.fine-tune-summary-bar {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(90, 110, 140, 0.10);
  border-bottom: 1px solid rgba(90, 110, 140, 0.10);
  margin-bottom: 10px;
}
.fine-tune-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(108, 63, 181, 0.05);
  border: 1px solid rgba(108, 63, 181, 0.10);
  border-radius: 10px;
}
.fine-tune-summary-label {
  font-size: 10px;
  font-weight: 600;
  color: #8a7aaa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fine-tune-summary-value {
  font-size: 15px;
  font-weight: 700;
  color: #3a2a5c;
  letter-spacing: -0.01em;
}

/* Target table */
.fine-tune-table-wrap {
  overflow-y: auto;
  max-height: 280px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 63, 181, 0.2) transparent;
}
.fine-tune-table-wrap::-webkit-scrollbar { width: 4px; }
.fine-tune-table-wrap::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(108, 63, 181, 0.2); }
.fine-tune-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed;
}
.fine-tune-table colgroup col:nth-child(1) { width: 20%; }
.fine-tune-table colgroup col:nth-child(2) { width: 40%; }
.fine-tune-table colgroup col:nth-child(3) { width: 40%; }
.fine-tune-table thead th {
  font-size: 10px;
  font-weight: 800;
  color: #4a5a6a;
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1.5px solid rgba(90, 110, 140, 0.18);
  position: sticky;
  top: 0;
  background: #f2f6fb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fine-tune-table thead th:nth-child(2),
.fine-tune-table thead th:nth-child(3) { text-align: center; }
.fine-tune-table tbody tr {
  border-bottom: 1px solid rgba(90, 110, 140, 0.06);
}
.fine-tune-table tbody tr:hover {
  background: rgba(108, 63, 181, 0.03);
}
.fine-tune-cell-name {
  padding: 5px 4px 5px 6px;
  font-weight: 600;
  color: #3a4a5c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fine-tune-cell-val {
  padding: 5px 4px;
  color: #2a3a4c;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.fine-tune-cell-val.is-adjusted {
  color: #1a8a7a;
}
.fine-tune-adjusted-icon {
  font-size: 9px;
  margin-right: 2px;
  color: #1a8a7a;
  vertical-align: middle;
}
.fine-tune-cell-mmol {
  color: #6a7a8a;
  font-size: 11.5px;
}
.fine-tune-legend[hidden] { display: none; }
.fine-tune-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  font-size: 10.5px;
  color: #6a7a8a;
}
.fine-tune-legend-icon {
  color: #1a8a7a;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Footer */
.fine-tune-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(255, 255, 255, 0.5);
}
/* Hassas Ayar ve Hedefleri Değiştir pencerelerindeki "Varsayılan Ayarlara Dön"
   butonları, diğer tüm pencerelerle (Gübre Seçimi, Gübre Düzenleme, Stok
   Düzenleme, Analiz, Katsayı) görsel olarak tutarlı olsun diye aynı discrete
   link-style kullanıyor. Daha önce fine-tune-reset-btn prominent (border+bg+
   44px) ayrı bir stildeydi; diğerlerinden farklı görünüyordu. */
.fine-tune-reset-btn,
.target-dlg-reset-btn {
  appearance: none;
  margin-right: auto;
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8a4820;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  align-self: center;
}
.fine-tune-reset-btn:hover,
.target-dlg-reset-btn:hover {
  opacity: 1;
  text-decoration: underline;
}
.fine-tune-reset-btn:active,
.target-dlg-reset-btn:active {
  opacity: 0.9;
}
.fine-tune-change-targets-btn {
  appearance: none;
  border: 1px solid rgba(108, 63, 181, 0.25);
  background: rgba(108, 63, 181, 0.06);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6c3fb5;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.fine-tune-change-targets-btn:hover {
  background: rgba(108, 63, 181, 0.12);
  border-color: rgba(108, 63, 181, 0.4);
}
.fine-tune-close-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #4a6a8a;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.fine-tune-close-btn:hover { background: rgba(90, 122, 156, 0.10); }
.fine-tune-save-btn {
  appearance: none;
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  color: #fff;
  padding: 8px 22px;
  margin-left: 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.fine-tune-save-btn:hover { background: #245a96; border-color: #245a96; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .fine-tune-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ───══════════════════════════════════════════════════════════════════════
   Target Settings Dialog overlay
   ═══════════════════════════════════════════════════════���══════════════ */
.target-dlg-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(18, 12, 32, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.target-dlg-overlay.hidden { display: none; }
.target-dlg-panel {
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, #f8fafd, #eef3f9);
  border: 1px solid rgba(86, 112, 138, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 8, 30, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: targetDlgFadeIn 0.2s ease;
}
@keyframes targetDlgFadeIn {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@media (min-width: 640px) {
  .target-dlg-overlay { padding: 16px; }
}
.target-dlg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.target-dlg-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #2a3a4c;
  margin: 0;
}
.target-dlg-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(46, 110, 180, 0.09);
  color: #2e6eb4;
  flex-shrink: 0;
}
.target-dlg-title-icon svg {
  width: 15px;
  height: 15px;
}
.target-dlg-close {
  appearance: none;
  border: none;
  background: rgba(90, 110, 140, 0.06);
  border-radius: 8px;
  font-size: 22px;
  color: #6a7a8a;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .target-dlg-close:hover {
    background: rgba(46, 110, 180, 0.10);
    color: #2e6eb4;
  }
}

.target-dlg-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.18);
}

/* EC bar */
/* EC bar — kilit KAPALI (varsayılan): mavi vurgu, EC aktif */
.target-dlg-ec-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(46, 110, 180, 0.18);
  background: rgba(46, 110, 180, 0.06);
  transition: background 0.22s ease, border-color 0.22s ease;
}
/* EC bar — kilit AÇIK: mor ton, EC otomatik türetiliyor */
.target-dlg-ec-bar.is-ec-unlocked {
  background: rgba(108, 63, 181, 0.05);
  border-bottom-color: rgba(108, 63, 181, 0.14);
}

/* EC kilit butonu — KAPALI: solid mavi */
.tdlg-ec-lock-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid #2e6eb4;
  border-radius: 7px;
  background: #2e6eb4;
  color: #fff;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(46, 110, 180, 0.28);
}
@media (hover: hover) and (pointer: fine) {
  .tdlg-ec-lock-btn:hover {
    background: #245a96;
    border-color: #245a96;
  }
}
/* Kilit AÇIK: mor konturlu, beyaz zemin */
.tdlg-ec-lock-btn.is-unlocked {
  background: rgba(255, 255, 255, 0.7);
  color: #6c3fb5;
  border-color: rgba(108, 63, 181, 0.35);
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .tdlg-ec-lock-btn.is-unlocked:hover {
    background: rgba(108, 63, 181, 0.08);
  }
}
.tdlg-ec-lock-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.18);
}

/* EC stepper — always active */

/* EC input — kilit KAPALI: soluk/hafif */
.target-dlg-ec-input {
  width: 72px;
  padding: 5px 8px;
  border: 1px solid rgba(46, 110, 180, 0.28);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6c3fb5;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
}
.target-dlg-ec-input:focus {
  outline: none;
  border-color: #2e6eb4;
  box-shadow: 0 0 0 2px rgba(46, 110, 180, 0.18);
}
/* Kilit AÇIK: EC input vurgulu */
.target-dlg-ec-bar.is-ec-unlocked .target-dlg-ec-input {
  color: #5b21b6;
  border-color: rgba(108, 63, 181, 0.28);
  font-weight: 700;
}
.target-dlg-cat-an {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #6a7a8a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.target-dlg-cat-an span:last-child {
  font-weight: 700;
  color: #2a3a4c;
}

/* ── Body: two equal-height columns, each with own scroll ── */
.target-dlg-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
}

.target-dlg-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.target-dlg-elements-col { flex: 6; }
.target-dlg-ratios-col {
  flex: 4;
  border-left: 1px solid rgba(90, 110, 140, 0.12);
}

/* ── Column widths (ppm/mmol) — must match between header grid and table colgroup.
   Mobilde değerlerin (örn. "106.79", "6.3539") stepper input'una tam sığması
   için ppm/mmol kolonları biraz genişletildi, element ad kolonu daraltıldı. */
col.tdlg-col-name { width: 14%; }
col.tdlg-col-ppm  { width: 43%; }
col.tdlg-col-mmol { width: 43%; }

/* ── Shared header base (font, border) ── */
.target-dlg-elements-header,
.target-dlg-ratios-header {
  flex-shrink: 0;
  border-bottom: 1.5px solid rgba(90, 110, 140, 0.22);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Elements header — blue tint */
.target-dlg-elements-header {
  display: grid;
  grid-template-columns: 14% 43% 43%;
  background: linear-gradient(180deg, #ddeaf7 0%, #d3e2f2 100%);
  color: #1e4a7a;
}
.target-dlg-elements-header span {
  padding: 9px 2px;
  text-align: center;
}
.target-dlg-elements-header span:first-child {
  text-align: left;
  padding-left: 6px;
}

/* Ratios header — purple tint, 2-column grid */
.target-dlg-ratios-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background: linear-gradient(180deg, #e8e0f5 0%, #ddd5ef 100%);
  color: #4a2a7a;
}
.target-dlg-ratios-header span {
  padding: 9px 2px;
  text-align: center;
}
.target-dlg-ratios-header span:first-child {
  text-align: left;
  padding-left: 8px;
}

/* Elements scroll area — blue body bg */
.target-dlg-elements-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: rgba(46, 110, 180, 0.018);
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 110, 180, 0.2) transparent;
}
.target-dlg-elements-scroll::-webkit-scrollbar { width: 4px; }
.target-dlg-elements-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(46, 110, 180, 0.22); }

/* Ratios scroll area — purple body bg */
.target-dlg-ratios-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 4px 10px 8px;
  background: rgba(108, 63, 181, 0.018);
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 63, 181, 0.2) transparent;
}
.target-dlg-ratios-scroll::-webkit-scrollbar { width: 4px; }
.target-dlg-ratios-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(108, 63, 181, 0.22); }

/* Elements table — no thead, colgroup sets widths */
.target-dlg-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}
.target-dlg-table tbody tr {
  border-bottom: 1px solid rgba(90, 110, 140, 0.07);
}
.target-dlg-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}
.target-dlg-cell-name {
  padding: 5px 4px 5px 6px;
  font-weight: 600;
  color: #3a4a5c;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Stepper cells centered under ppm / mmol headers */
.target-dlg-table td:not(.target-dlg-cell-name) {
  text-align: center;
  padding: 4px 1px;
  vertical-align: middle;
}
/* PPM ↔ mmol arası net ayrım */
.target-dlg-cell-ppm { padding-left: 0; padding-right: 2px; }
.target-dlg-cell-mmol { padding-left: 2px; padding-right: 0; border-left: 1px solid rgba(90, 110, 140, 0.08); }
/* Compact [−][input][+] stepper for target dialog */
.tdlg-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(90, 110, 140, 0.20);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.tdlg-nudge {
  appearance: none;
  border: none;
  border-radius: 0;
  background: rgba(90, 110, 140, 0.07);
  cursor: pointer;
  width: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #5a6a7a;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
  min-height: 28px;
}
@media (hover: hover) and (pointer: fine) {
  .tdlg-nudge:hover { background: rgba(46, 110, 180, 0.12); color: #2e6eb4; }
}
.tdlg-nudge:active { background: rgba(46, 110, 180, 0.22); }
.tdlg-nudge:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(46, 110, 180, 0.18);
}
.tdlg-nudge-minus { border-right: 1px solid rgba(90, 110, 140, 0.14); }
.tdlg-nudge-plus  { border-left:  1px solid rgba(90, 110, 140, 0.14); }
.tdlg-stepper .target-dlg-input,
.tdlg-stepper .target-dlg-ec-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center;
  min-width: 0;
  background: #fff;
}
.tdlg-stepper .target-dlg-input { width: 54px; }
/* EC stepper — unit inside */
.tdlg-ec-inner {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 0 4px 0 2px;
  gap: 2px;
  min-width: 0;
}
.tdlg-stepper-ec .target-dlg-ec-input {
  width: 42px;
  padding: 4px 0;
  flex-shrink: 0;
}
.tdlg-ec-unit-inline {
  font-size: 10px;
  font-weight: 700;
  color: #8a9aaa;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.target-dlg-ec-bar.is-ec-unlocked .tdlg-ec-unit-inline {
  color: #8a6abf;
}
/* Hide browser number spinners inside stepper */
.tdlg-stepper input[type="number"]::-webkit-inner-spin-button,
.tdlg-stepper input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tdlg-stepper input[type="number"] { -moz-appearance: textfield; }

.target-dlg-input {
  width: 72px;
  padding: 3px 4px;
  border: 1px solid rgba(90, 110, 140, 0.18);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #2a3a4c;
  background: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.target-dlg-input:focus {
  outline: none;
  border-color: #2e6eb4;
}

/* ==================================================================
   Target Settings Dialog - ratios row layout (missing prior to 20260410a03)
   .target-dlg-ratios-header is a 2-col grid (1fr 1fr) but row elements
   had no CSS at all, so label + stepper collided / wrapped awkwardly.
   Mirror the same 2-col grid with vertical alignment.
   ================================================================== */
.target-dlg-ratio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 6px 4px 6px 8px;
  border-bottom: 1px solid rgba(108, 63, 181, 0.07);
  gap: 6px;
}
.target-dlg-ratio-row:last-child { border-bottom: none; }
.target-dlg-ratio-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #4a2a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  padding-right: 2px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  min-width: 0;
}
.target-dlg-ratio-row .tdlg-stepper {
  justify-self: center;
}

/* ==================================================================
   Target Settings Dialog - footer (missing prior to 20260410a03)
   Mirrors .fine-tune-footer layout so reset / close / save buttons
   sit in the same place and have the same pill sizing as other
   windows (Hassas Ayar, Gubre Secimi, Analiz).
   ================================================================== */
.target-dlg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(90, 110, 140, 0.12);
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}
.target-dlg-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.target-dlg-cancel-btn {
  appearance: none;
  border: 1px solid rgba(90, 110, 140, 0.22);
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #4a6a8a;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.target-dlg-cancel-btn:hover { background: rgba(90, 122, 156, 0.10); }
.target-dlg-save-btn {
  appearance: none;
  border: 1px solid #2e6eb4;
  background: #2e6eb4;
  color: #fff;
  padding: 8px 22px;
  margin-left: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.target-dlg-save-btn:hover { background: #245a96; border-color: #245a96; }
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .target-dlg-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ==================================================================
   Plant Selection close (X) - normalize dimensions to match the
   common close-button spec across all other overlays (Analiz,
   Hassas Ayar, Gubre Editor, Stok Editor, Hedef Ayarlari).
   Color / tint is kept green to preserve per-window theming, but
   size / radius / font are now consistent.
   ================================================================== */
.plant-sel-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 22px;
  padding: 0;
  min-width: 40px;
  min-height: 40px;
}
