:root {
  color-scheme: light;
  --bg: #e9eef0;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dce4ed;
  --line-strong: #c4d0dd;
  --text: #162235;
  --text-2: #4b5d70;
  --muted: #66758a;
  --icon: #7f8c99;
  --sunken: #eef2f6;
  --on-accent: #ffffff;
  --blue: #1267a8;
  --blue-dark: #0d4f84;
  --blue-soft: #eaf5ff;
  --danger: #a32f39;
  --danger-soft: #fff2f3;
  --ok: #1f8a5b;
  --warn: #c27c0e;
  --bad: #c2414b;
  --focus: #f3a712;
  --scrim-rgb: 9, 28, 46;
  --shadow-rgb: 26, 51, 78;
  --shadow: 0 1px 2px rgba(var(--shadow-rgb), .05), 0 4px 16px rgba(var(--shadow-rgb), .05);
  --scrollbar-thumb: rgba(86, 105, 126, .34);
  --scrollbar-thumb-active: rgba(67, 88, 110, .62);
  --page-max-width: 960px;
  --page-gutter: clamp(12px, 2vw, 24px);
  /* ÖLÇÜ TOKENLARI — çalışma alanı (liste, tablo, özet, sonuç) bu değerleri kullanır.
     Uzun adlar ve erişilebilirlik (dokunmatik, metin büyütme) gerekirse aşılabilir. */
  --fs-data: .8125rem;      /* 13 px: sayısal değer, ürün adı, tablo hücresi */
  --fs-label: .75rem;    /* 12 px: etiket, yardımcı bilgi, sütun başlığı */
  --fs-meta: .75rem;       /* 12 px: birim, marka gibi ikincil bilgi */
  --fs-section: .9375rem; /* 15 px: bölüm başlığı */
  --control-h: 28px;       /* masaüstü giriş / düğme yüksekliği */
  --row-h: 34px;           /* liste ve tablo satırı (en az) */
  --window-card-min: 160px; /* havuz ve bileşik kartlarının ortak alt sütun ölçüsü */
  --pad-panel: 10px;       /* panel iç boşluğu */
  --region-gap: 12px;      /* girdi ve sonuç bölgeleri arası */
  /* İki bölge (≥1180 px): girdiler | sonuçlar. Sonuç bölgesi tablo ve reçete taşıdığı
     için daha geniş; ikisi de satırların gereksiz uzamaması için sınırlı. */
  --region-columns: minmax(360px, 5fr) minmax(460px, 7fr);
  /* İÇERİK SÜTUNU: başlık çubuğu ve iki sayfa aynı hizayı kullanır.
     --content-shift: soldaki menünün kapladığı yer (side_drawer.css ≥768px).
     Çalışma alanı bu menünün hemen sağında, sol üstte başlar. */
  --content-shift: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
  min-width: 32px;
  min-height: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}
*:focus-within { scrollbar-color: var(--scrollbar-thumb-active) transparent; }
*:focus-within::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb-active); }

html {
  min-height: 100%;
  background: #0d2740;
  overscroll-behavior-y: none;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-size: var(--fs-data);
  background: var(--bg);
}

button, input, select { font: inherit; }
button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 48px;
  /* Logo ve sekmeler sayfadaki kartların kenarlarıyla hizalı. */
  padding: max(6px, env(safe-area-inset-top))
    max(var(--page-gutter), env(safe-area-inset-right))
    6px
    max(calc(var(--content-shift) + var(--page-gutter)), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0d2740;
  color: var(--on-accent);
  border-bottom: 3px solid #1b7bbd;
  box-shadow: 0 5px 18px rgba(7, 24, 40, .16);
  isolation: isolate;
}

.app-brand { flex: none; color: var(--on-accent); font-size: 1rem; font-weight: 800; letter-spacing: .01em; }
.status { margin: 0; color: #c7d8e8; font-size: .78rem; }
.status.is-error { color: #ffd7da; }

.workspace,
.optimization-page {
  width: min(var(--page-max-width), 100%);
  margin: 0;
  padding: clamp(12px, 2vw, 24px)
    max(var(--page-gutter), env(safe-area-inset-right))
    max(clamp(12px, 2vw, 24px), env(safe-area-inset-bottom))
    max(var(--page-gutter), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--region-gap);
  align-items: start;
}

/* ---------- İki bölge: girdiler | sonuçlar ----------
   Yeterli genişlikte (ray hariç ~1100 px içerik) iki mod da yan yana iki bölgeye
   ayrılır; daha dar ekranda alt alta (tek sütun en fazla 960 px, satırlar uzamaz).
   Optimizasyon sayfasının öğe yerleşimi optimizasyon/styles.css'te. */
@media (min-width: 1180px) {
  :root { --page-max-width: 1440px; }
  .workspace,
  .optimization-page { grid-template-columns: var(--region-columns); }
}

.input-panel,
.analysis-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.input-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

.section-head,
.analysis-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head {
  min-height: 42px;
  padding: 6px var(--pad-panel);
  border-bottom: 1px solid var(--line);
}

h2 { margin: 0; font-size: var(--fs-section); }
.section-head h2 { margin-right: auto; }

.calculator-reset-button {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.calculator-reset-button span { margin-right: 3px; color: var(--text-2); font-size: 1rem; font-weight: 500; }
/* Uyarı düğmesi başlığın sağ ucunda; Optimizasyon "Gübreler" başlığıyla aynı yer. */
.section-alerts { display: flex; }
/* ---------- Tank sekmeleri ----------
   Ölçü, boşluk ve yazı dili sonuç sekmeleriyle ortaktır (workspace_components.css);
   burada yalnız tanka özgü yapı ve durum işaretleri kalır. */
.tank-tabbar {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.tank-tabs { min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tank-tabs::-webkit-scrollbar { display: none; }
.tank-tab {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
}
.tank-tab[aria-selected="true"] { border-color: var(--line); background: var(--surface); color: var(--text); }
.tank-tab:not([aria-selected="true"]) .tank-badge { opacity: .7; }
.tank-tab:focus-visible { outline-offset: -3px; }
.tank-tab-count {
  min-width: 20px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--text-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tank-tab-count:empty { display: none; }
.tank-tab.has-warning::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warn);
}
.tank-tab[data-risk="high"]::after { background: var(--danger); }
.tank-tab-add {
  padding: 0;
  display: grid;
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.tank-tab-add svg { width: 18px; height: 18px; }

/* Tanklar arası aktarım (tank_transfer.js) */
.transfer-dialog { width: min(620px, calc(100% - 24px)); }
.transfer-dialog[open] { display: flex; flex-direction: column; }
.transfer-dialog h2 { font-size: 1rem; }
.transfer-body { min-height: 0; padding: 8px 12px 6px; display: grid; gap: 8px; overflow: auto; overscroll-behavior: contain; }
.transfer-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.transfer-chip {
  min-height: 46px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.transfer-chip small { grid-column: 1 / -1; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.transfer-chip strong { font-size: .86rem; }
.transfer-swap {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-2);
  cursor: pointer;
  transition: transform .2s ease;
}
.transfer-swap:active { transform: rotate(180deg); }
.transfer-swap svg { width: 18px; height: 18px; }
.transfer-gauge { padding: 6px 8px; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); transition: border-color .2s ease, background-color .2s ease; }
.transfer-gauge.is-balanced { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.transfer-gauge-row { display: grid; grid-template-columns: auto 1fr minmax(92px, auto); align-items: center; gap: 10px; }
.transfer-track { position: relative; height: 10px; border-radius: 999px; background: var(--sunken); }
.transfer-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--tank-accent); transition: width .18s ease; }
.transfer-mean { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-2); opacity: .55; }
.transfer-ec { color: var(--text); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.transfer-ec s { color: var(--muted); font-size: .72rem; }
.transfer-status { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 650; text-align: center; }
.transfer-status.is-balanced { color: var(--ok); }
.transfer-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.transfer-list-title { color: var(--text-2); font-size: .76rem; font-weight: 700; }
.transfer-auto {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--line));
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
}
.transfer-list { display: grid; gap: 6px; }
.transfer-item {
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(110px, 1.1fr) 68px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.transfer-item.is-moving { border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.transfer-item.is-blocked { opacity: .62; }
.transfer-item.is-blocked .transfer-name small { color: var(--danger); white-space: normal; }
.transfer-logo { width: 28px; height: 28px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.transfer-logo img { width: 22px; height: 22px; object-fit: contain; }
.transfer-name { min-width: 0; display: grid; gap: 1px; }
.transfer-name strong { overflow: hidden; color: var(--text); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.transfer-name small { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.transfer-slider {
  --fill: 0%;
  width: 100%;
  height: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--blue) var(--fill), var(--sunken) var(--fill));
  appearance: none;
  cursor: pointer;
}
.transfer-slider::-webkit-slider-thumb { width: 18px; height: 18px; border: 2px solid var(--blue); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); appearance: none; }
.transfer-slider::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--blue); border-radius: 50%; background: var(--surface); }
.transfer-slider:disabled { cursor: not-allowed; }
.transfer-amount { color: var(--text); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.transfer-empty { margin: 0; padding: 12px; color: var(--muted); font-size: .8rem; text-align: center; }
.transfer-foot { padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.transfer-note { margin-right: auto; color: var(--muted); font-size: .72rem; }

/* Tank kimlik rengi: yalnız tank harflerinde (sekme rozeti, kart tank etiketi). */
[data-tone] { --tank-accent: #6e7c8c; }
[data-tone="0"] { --tank-accent: #6f5aa3; }
[data-tone="1"] { --tank-accent: #b0577f; }
[data-tone="2"] { --tank-accent: #2f7d72; }
[data-tone="3"] { --tank-accent: #a06b25; }
[data-tone="4"] { --tank-accent: #3a71a1; }
[data-tone="5"] { --tank-accent: #8a5277; }
[data-tone="6"] { --tank-accent: #4e7680; }
[data-tone="7"] { --tank-accent: #7a6745; }
.tank-badge {
  width: 22px;
  height: 22px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 6px;
  background: var(--tank-accent);
  color: var(--on-accent);
  font-size: .72rem;
  font-weight: 800;
}

.tank-panel { min-width: 0; background: var(--surface); }
.tank-workspace { min-width: 0; display: flex; flex-direction: column; }
/* Tank özeti: gübre miktarı · EC · hacim (sığmazsa kendi içinde kırılır).
   Yalnız bilgi taşır; tank eylemleri rafın alt satırındadır (.tank-shelf-foot). */
.tank-workspace-head {
  padding: 8px 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tank-summary { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.tank-summary-item { display: flex; align-items: baseline; gap: 4px; }
.tank-summary-item small { color: var(--muted); font-size: var(--fs-meta); font-weight: 600; }
.tank-summary-item output { color: var(--text); font-size: var(--fs-data); font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Tank hacmi: tanka özgü, satırda düzenlenir */
.tank-volume-item { align-items: center; cursor: text; }
.tank-volume-control { position: relative; display: inline-flex; }
.tank-volume-control small { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.tank-volume-input {
  width: 12ch;
  min-height: 30px;
  padding: 3px 24px 3px 7px;
  border-color: var(--line-strong);
  color: var(--text);
  font-size: .84rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* Tank eylem satırı: solda "Gübre ekle", sağ uçta "Tankı sil". */
.tank-shelf-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--workspace-gap);
}
.tank-remove-button {
  min-height: var(--control-h);
  margin-left: auto;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--workspace-card-radius);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-meta);
  white-space: nowrap;
  font-weight: 650;
  cursor: pointer;
}

/* ---------- Uyarılar (notice.js): uygulama genelinde tek görünüm ----------
   Beyaz zemin, sol kenarda risk rengi; metin tek satır, düğme ne yapılacağını söyler. */
.notice-list { display: grid; gap: 6px; }
.notice-list[hidden] { display: none; }
.notice {
  --notice: var(--blue);
  min-width: 0;
  padding: 7px 8px 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--notice);
  border-radius: 9px;
  background: var(--surface);
}
.notice[data-tone="danger"] { --notice: var(--danger); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.notice[data-tone="warn"],
.notice-trigger[data-tone="warn"] { --notice: var(--warn); }
.notice[data-tone="info"] { --notice: var(--blue); }
.notice-trigger[data-tone="danger"] { --notice: var(--danger); }

/* Ünlem düğmesi: uyarılar tıklanınca pencerede açılır (notice.js group) */
.notice-trigger {
  --notice: var(--blue);
  min-height: 28px;
  padding: 3px 10px 3px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--notice) 32%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--notice) 6%, var(--surface));
  color: var(--text-2);
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.notice-trigger-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--notice);
  color: var(--on-accent);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}
.notice-dialog { width: min(560px, calc(100% - 24px)); }
.notice-dialog[open] { display: flex; flex-direction: column; }
.notice-dialog h2 { font-size: 1rem; }
.notice-dialog-list { min-height: 0; padding: 8px 12px; overflow: auto; overscroll-behavior: contain; }
.notice-dialog .notice-detail { white-space: normal; }
.notice-body { min-width: 0; flex: 1; display: grid; gap: 1px; }
.notice-text { color: var(--text); font-size: .8rem; font-weight: 600; line-height: 1.35; }
.notice-detail { overflow: hidden; color: var(--muted); font-size: .72rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notice-action {
  min-height: 30px;
  padding: 4px 12px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--notice) 45%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.tank-warnings { margin: 10px 14px 0; }

.text-button {
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
}

.primary { border-color: var(--blue); background: var(--blue); color: var(--on-accent); }
.danger { color: var(--danger); border-color: #e5c3c7; }
button:disabled { opacity: .5; cursor: not-allowed; }

.editor-main label,
.compound-search {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}

input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }


.amount-input { min-width: 0; }
.unit-select { min-width: 0; }

.analysis-workspace {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.analysis-card { min-width: 0; overflow: hidden; }
.analysis-head { min-height: 52px; padding: 8px 10px; border-bottom: 1px solid var(--line); justify-content: space-between; }
.analysis-head h2 { flex: none; }

.fertilizer-dialog {
  width: min(720px, calc(100% - 24px));
  height: fit-content;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(10, 30, 50, .3);
}
/* Kipsel pencerelerin konumu, en büyük boyu ve perdesi overlay_scrim.css'te. */
.confirm-dialog {
  width: min(460px, calc(100% - 24px));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(10, 30, 50, .3);
}
.confirm-dialog form { max-height: calc(100dvh - var(--scrim-top) - var(--scrim-bottom) - 26px); display: flex; overflow: hidden; flex-direction: column; }
.confirm-head { min-height: 46px; padding: 5px 8px 5px 12px; display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.confirm-dialog h2 { min-width: 0; padding: 0; }
.confirm-dialog p { min-height: 0; margin: 0; padding: 10px 12px; overflow: auto; overscroll-behavior: contain; color: var(--muted); font-size: .85rem; }
.action-feedback { position: relative; min-width: 76px; overflow: hidden; }
.action-feedback-label { display: block; transition: opacity .18s ease; }
.action-feedback-check { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ok); opacity: 0; pointer-events: none; }
.action-feedback-check svg { width: 18px; height: 18px; }
/* Tik anında düğme zemini kalkar (fare üstündeyken de): yeşil tik her düğmede aynı görünür. */
.action-feedback.is-acknowledged,
.action-feedback.is-acknowledged:hover { border-color: transparent; background: transparent; box-shadow: none; }
.action-feedback.is-acknowledged .action-feedback-label { opacity: 0; }
.action-feedback.is-acknowledged .action-feedback-check { animation: action-feedback-ack .86s ease both; }
.action-feedback:disabled { cursor: default; }
.action-feedback:disabled.is-acknowledged { opacity: 1; }
.action-feedback:disabled:not(.is-acknowledged) { opacity: .35; }
@keyframes action-feedback-ack {
  0% { opacity: 0; transform: scale(.78); }
  18%, 70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06); }
}
.fertilizer-dialog form { width: 100%; max-height: calc(var(--window-height) - 2px); min-height: 0; display: flex; overflow: hidden; flex-direction: column; }
.dialog-head { min-height: 46px; padding: 5px 8px 5px 12px; display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head-actions { display: flex; align-items: center; gap: 7px; }
.editor-body { min-height: 0; flex: 0 1 auto; overflow: auto; overscroll-behavior: contain; }
.editor-main { padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.editor-main label { min-width: 0; }
.compound-search { width: min(100%, 32ch); padding: 0 12px 6px; }
.compound-search input { min-height: 34px; }
.compound-percent-help { margin: 0; padding: 0 12px 6px; color: var(--muted); font-size: .68rem; }
.compound-editor { min-height: 0; padding: 2px 12px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--window-card-min)), 1fr)); gap: 4px 6px; align-content: start; }
.compound-field { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 9ch; gap: 6px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.compound-field span { overflow-wrap: anywhere; font-size: .78rem; line-height: 1.5; }
.compound-percent-input { position: relative; min-width: 0; }
.compound-field .compound-percent-input input { min-width: 0; min-height: 30px; padding: 3px 20px 3px 4px; text-align: right; font-variant-numeric: tabular-nums; font-size: .85rem; }
.compound-percent-input b { position: absolute; top: 50%; right: 7px; color: var(--muted); font-size: .68rem; font-weight: 600; pointer-events: none; transform: translateY(-50%); }
.form-error { margin: 10px 16px 0; padding: 9px 10px; flex: none; border-radius: 7px; color: var(--danger); background: var(--danger-soft); font-size: .78rem; }
.dialog-actions { padding: 8px 12px; display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); background: var(--surface); }
.dialog-commit-actions { margin-left: auto; display: flex; gap: 8px; }
/* Pencere ayakları: yardımcı eylemler solda sakin düğme (Varsayılana dön, Yeni gübre,
   Sıfırla); karar düğmeleri sağda [Vazgeç] [Kaydet / Sil / Aktar / Bitti]. */
.quiet-button { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); border-color: transparent; background: transparent; font-weight: 600; }

@media (hover: hover) and (pointer: fine) {
  *:hover { scrollbar-color: var(--scrollbar-thumb-active) transparent; }
  *:hover::-webkit-scrollbar-thumb,
  *::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-active); }
  .calculator-reset-button:hover { border-color: var(--line); background: var(--surface-soft); color: var(--text); }
  .tank-tab:not([aria-selected="true"]):hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text); }
  .tank-tab-add:hover { background: var(--sunken); color: var(--text); }
  .tank-remove-button:hover { background: var(--danger-soft); color: var(--danger); }
  .notice-action:hover { border-color: var(--notice); background: color-mix(in srgb, var(--notice) 8%, var(--surface)); }
  .notice-trigger:hover { border-color: var(--notice); background: color-mix(in srgb, var(--notice) 11%, var(--surface)); }
  .transfer-chip:hover,
  .transfer-swap:hover { border-color: var(--icon); background: var(--surface-soft); color: var(--text); }
  .transfer-auto:hover:not(:disabled) { border-color: var(--blue); }
  .primary:hover { background: var(--blue-dark); }
  .quiet-button:hover { color: var(--text); border-color: var(--line); background: var(--surface-soft); }
}

/* Dokunmatik ekran: parmakla rahat basılabilen hedefler (masaüstü fare görünümü değişmez). */
@media (pointer: coarse) {
  .tank-volume-input { min-height: 38px; font-size: 1rem; }
  .tank-remove-button { min-height: 44px; }
  .notice-action { min-height: 38px; }
  .notice-trigger { min-height: 36px; }
  .transfer-auto { min-height: 38px; }
  .transfer-slider { height: 8px; }
  .transfer-slider::-webkit-slider-thumb { width: 26px; height: 26px; }
}

@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  *::-webkit-scrollbar-thumb { border-color: Canvas; background: CanvasText; }
}

@media (max-width: 820px) {
  :root { --page-gutter: 10px; }
  .topbar { min-height: 58px; }
  .workspace { padding-block: 10px max(10px, env(safe-area-inset-bottom)); }
  .editor-main { grid-template-columns: 1fr 1fr; }
  .editor-main label:first-child { grid-column: 1 / -1; }
}


@media (max-width: 600px) {
  .app-brand { display: none; }
  input,
  select,
  .compound-field .compound-percent-input input { font-size: 1rem; }
  .transfer-body { padding-inline: 12px; }
  .transfer-chip { padding-inline: 8px; }
  .transfer-item { grid-template-columns: 28px minmax(0, 1fr) auto; row-gap: 8px; }
  .transfer-slider { grid-column: 1 / -1; grid-row: 2; }
  .transfer-foot { padding-inline: 12px; }
  .tank-workspace-head { padding-inline: 10px; }
  .tank-warnings { margin-inline: 10px; }
  .notice { flex-wrap: wrap; }
  .notice-action { margin-left: auto; }
  .editor-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-main label:first-child { grid-column: 1 / -1; }
  .compound-field { grid-template-columns: minmax(0, 1fr) 9ch; }
  .compound-field .compound-percent-input input { min-height: 36px; }
  .fertilizer-dialog .dialog-actions { flex-wrap: wrap; }
  .confirm-dialog .dialog-actions { flex-wrap: wrap; }
  .dialog-commit-actions { margin-left: auto; }
}


@media (max-width: 360px) {
  .compound-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html { scroll-padding-top: 90px; }
  .section-head { flex-wrap: wrap; gap: 6px 8px; }
  .section-head h2 { width: 100%; margin-right: 0; }
  .calculator-reset-button { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .action-feedback-label { transition: none; }
  .action-feedback.is-acknowledged .action-feedback-check { animation: none; opacity: 1; transform: none; }
}

