/* ==========================================================================
   BluCory v2 - yeni kutularin bicimleri

   style.css klasik temanin kendisi ve v1'deki haliyle duruyor. Bu dosya
   yalnizca v2 ile gelen bilesenleri bicimlendiriyor: tema secici, bakim
   hatirlaticilari, su testleri ozeti, canli sayimlari.

   Renkler style.css'teki degiskenlerden (--card, --ink, --brand...)
   geliyor; her temada ve aydinlik/karanlik modda kendiliginden uyar.
   ========================================================================== */

/* --- Kart basligindaki sayi ---------------------------------------------- */

.card__badge {
  flex: none;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--alert);
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* --- Tema secici ---------------------------------------------------------- */

.uigrid {
  display: grid;
  /* v3: dort tema, ikiser ikiser. Telefonda alt alta satirlar. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.uibtn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 10px;
  border: 2px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--track);
  cursor: pointer;
  user-select: none;
  min-width: 0;
  transition: border-color .15s ease, background .15s ease;
}

/* Radyo dugmesi gizli ama klavyeyle gezilebilir durumda */
.uibtn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uibtn:hover { border-color: var(--brand); }

.uibtn.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.uibtn:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.uibtn__prev {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-line);
  line-height: 0;
  aspect-ratio: 120 / 78;
}

.uiprev {
  display: block;
  width: 100%;
  height: 100%;
}

.uibtn__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
}

.uibtn__on {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
}

.uibtn__desc {
  font-size: .78rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.uimode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--card-line);
}

.uimode__seg { grid-template-columns: repeat(3, 1fr); }
.uimode__seg .segmented__btn.is-active { background: var(--brand); }

@media (max-width: 560px) {
  .uigrid { grid-template-columns: 1fr; }

  .uibtn {
    display: grid;
    grid-template-columns: 104px 1fr;
    grid-template-areas: "prev name" "prev desc";
    align-items: start;
    column-gap: 12px;
    row-gap: 3px;
    padding: 8px;
  }

  .uibtn__prev { grid-area: prev; }
  .uibtn__name { grid-area: name; padding-top: 2px; }
  .uibtn__desc { grid-area: desc; }
}

/* --- Bakim hatirlaticilari ------------------------------------------------ */

.rems {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rem {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--track);
  border: 1px solid var(--card-line);
  border-left: 3px solid var(--card-line);
}

.rem__main {
  flex: 1 1 150px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rem__name { font-size: .95rem; }

.rem__meta {
  font-size: .78rem;
  color: var(--ink-3);
  line-height: 1.45;
}

.rem__state {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  background: var(--card);
  border: 1px solid var(--card-line);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.rem__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.rem__tools .btn { text-decoration: none; }
.rem__tools .btn--outline { width: auto; border-width: 1px; }

/* Durum rengi: sol kenar ve rozet */
.rem--late  { border-left-color: var(--alert); }
.rem--today,
.rem--never { border-left-color: var(--warn); }
.rem--soon  { border-left-color: var(--info); }
.rem--ok    { border-left-color: var(--ok); }

.rem--late .rem__state  { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }
.rem--today .rem__state,
.rem--never .rem__state { background: var(--warn-soft);  border-color: var(--warn);  color: var(--warn); }
.rem--soon .rem__state  { background: var(--info-soft);  border-color: var(--info);  color: var(--info); }

.remadd {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 10px;
  align-items: end;
}

.remadd .field { margin: 0; }
.remadd .field input { background: var(--card); }
.remadd .select { background-color: var(--card); }
.remadd__add { min-height: 48px; }
.remadd__note { display: block; margin: 12px 0 0; }

@media (max-width: 560px) {
  .remadd { grid-template-columns: 1fr 96px; }
  .remadd__add { grid-column: 1 / -1; width: 100%; }
}

/* --- Su testleri ozeti ---------------------------------------------------- */

.trends {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.trend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(84px, auto);
  grid-template-areas:
    "name spark val"
    "when spark val";
  align-items: center;
  column-gap: 12px;
  row-gap: 1px;
  padding: 9px 0;
  border-bottom: 1px solid var(--card-line);
}

.trend:last-child { border-bottom: 0; }

.trend__name {
  grid-area: name;
  font-weight: 700;
  font-size: .92rem;
  min-width: 0;
}

.trend__when {
  grid-area: when;
  font-size: .74rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.trend__spark {
  grid-area: spark;
  display: flex;
  align-items: center;
  color: var(--brand);
  min-height: 28px;
}

.spark { display: block; width: 100%; height: 28px; overflow: visible; }

.trend__val {
  grid-area: val;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend__val b { font-size: 1.12rem; font-weight: 800; }

.trend__unit {
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-2);
}

.trend__dir {
  display: inline-flex;
  align-self: center;
  color: var(--ink-3);
  font-weight: 800;
  font-size: .8rem;
}

.trend__dir--up   { color: var(--warn); }
.trend__dir--down { color: var(--info); }

.card .export { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--card-line); }
.card .export .btn { text-decoration: none; }

@media (max-width: 430px) {
  .trend { grid-template-columns: minmax(0, 1fr) 64px minmax(72px, auto); column-gap: 8px; }
}

/* --- Canli sayimlari ------------------------------------------------------ */

.stocksum {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
}

.stocksum__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--card-line);
  font-size: .8rem;
  color: var(--ink-2);
}

.stocksum__item b {
  font-size: .95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- Gunluk formu: hacim orani ipucu -------------------------------------- */

#logPct { color: var(--brand); font-weight: 700; }

/* --- Duzeltme: grafik araligi dugmesi ------------------------------------- */

/* v1'de secili aralik ("24 saat") acik gri zeminde beyaz yaziyla
   kaliyordu ve okunmuyordu: .segmented__btn.is-active yalnizca yazi
   rengini veriyor, zemini priz modlarina ozel kurallar boyuyor. */
.charts__range .segmented__btn.is-active {
  background: var(--brand);
  color: #fff;
}

/* ==========================================================================
   v3 ile gelenler (butun temalarda)
   ========================================================================== */

/* --- Kutu ici alt baslik --------------------------------------------------- */

.subhead {
  margin: 0 0 6px;
  font-size: .98rem;
  font-weight: 800;
  color: var(--ink);
}

.form + .cal,
.cal { margin-top: 26px; }

/* --- Sensor kalibrasyonu ---------------------------------------------------- */

.calbox {
  position: relative;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--track);
}

.calbox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.calbox__title {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
  color: var(--ink);
}

.calbox__state {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-3);
}

.calbox.is-cal .calbox__state { color: var(--ok); }

.calbox__missing {
  margin: 0 0 10px;
  font-size: .86rem;
  color: var(--ink-2);
}

/* Sensorun o anki ham okumasi */
.calbox__live {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--card-line);
}

.calbox__livelabel {
  flex: 1 1 100%;
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-3);
}

.calbox__raw {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.calbox__unit {
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink-2);
}

.calbox__stab {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

.calbox__stab.is-ok  { background: var(--ok-soft); color: var(--ok); }
.calbox__stab.is-off { background: var(--track); color: var(--ink-3); }

.calsteps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.calstep {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
}

.calstep__n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}

.calstep__txt {
  margin: 3px 0 8px;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.calstep__row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.calstep__row .field { margin: 0; min-width: 0; }
.calstep__row .field input,
.calstep__row .select { width: 100%; min-width: 0; background-color: var(--card); }
.calstep__other { margin-top: 6px; }

.calstep__take {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
}

.calstep__take[disabled] { opacity: .45; cursor: not-allowed; }
.calstep__take.is-done { border-color: var(--ok); color: var(--ok); }

.calform__save { margin-top: 14px; width: 100%; }

.calbox__now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--card-line);
}

.calbox__note {
  font-size: .8rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.calbox__reset { margin: 0; }
.calbox__reset .btn { margin: 0; padding: 8px 12px; font-size: .82rem; }

.cal__temp { margin-top: 12px; }

@media (max-width: 460px) {
  .calstep__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .calstep__take { grid-column: 1 / -1; }
}

/* --- Wifi sinyali: rakamla -------------------------------------------------- */

/* Masaustunde logonun ustune gelince ipucu cikiyor; dokunmatik ekranda
   ipucu olmadigi icin yuzde, logonun yaninda rakamla yaziyor. */
.sigpct {
  display: none;
  align-self: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--track);
  color: var(--ink-2);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sigpct--3 { color: var(--ok); }
.sigpct--2 { color: var(--warn); }
.sigpct--1 { color: var(--alert); }
.sigpct[hidden] { display: none !important; }

@media (hover: none), (max-width: 760px) {
  .sigpct { display: inline-block; }
}

/* Rakam butun temalarda markanin (logo baglantisinin) icinde. */
.brand .sigpct { margin: 0 0 0 2px; }

/* Klasik: ust cubukta bos yer yok. Rakam logonun altina, kucuk bir
   etiket olarak iniyor ve hic yer kaplamiyor. */
.topbar__brand { position: relative; }

.topbar__brand .sigpct {
  position: absolute;
  top: 100%;
  left: 22px;
  margin: -8px 0 0;
  padding: 0 5px;
  border: 1px solid var(--card-line);
  background: var(--card);
  font-size: .6rem;
  line-height: 1.45;
  transform: translateX(-50%);
}

/* Derin: dar telefonda cubukta yer kalmiyor. Saat olcum kutusunda da
   var; cok dar ekranda baglanti yazisi yerine yalniz isigi kaliyor. */
@media (max-width: 480px) {
  html.ui-derin .bar__clock { display: none; }
}

@media (max-width: 360px) {
  html.ui-derin .bar__status .conn__text { display: none; }
}

/* --- Ipucu balonu ----------------------------------------------------------- */

/* Fareyle bir menunun ya da nesnenin ustune gelince ne oldugunu soyleyen
   kisa not. Balonu ui.js govdeye ekliyor; metin [data-tip] (ya da var
   olan title) niteliginden geliyor. Dokunmatik ekranda cikmaz. */
.bctip {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  max-width: min(280px, calc(100vw - 16px));
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--tip-bg, #16222f);
  color: var(--tip-ink, #fff);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .12s ease, transform .12s ease;
}

.bctip.is-on { opacity: 1; transform: none; }

.bctip::after {
  content: "";
  position: absolute;
  left: var(--tip-x, 50%);
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  background: inherit;
  transform: rotate(45deg);
}

.bctip--up::after   { bottom: -4px; }
.bctip--down::after { top: -4px; }

[data-theme="dark"] .bctip {
  background: var(--tip-bg, #eef3f8);
  color: var(--tip-ink, #16222f);
}

@media (prefers-reduced-motion: reduce) {
  .bctip { transition: none; }
}

/* --- Sosyal medya baglantilari ---------------------------------------------- */

.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social__link {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-line);
  background: var(--card);
  color: var(--ink-2);
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.social__link:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }

/* Simgenin yaninda hesabin adi da yaziyorsa */
.social__link--text {
  display: inline-flex;
  gap: 7px;
  width: auto;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 700;
}

/* Sayfa altinda: kucuk, sessiz simgeler */
.social--foot { gap: 6px; margin-left: 4px; }

.social--foot .social__link {
  width: 30px;
  height: 30px;
  background: none;
  color: var(--ink-3);
}

.social--foot .social__link:hover { color: var(--brand); transform: none; }

.social--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--card-line);
}

.social__label {
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink-2);
}

/* --- Duzeltme: gunluk formu dar telefonda tasiyordu ------------------------- */

/* style.css'teki ".newlog .field:first-child" kurali hic eslesmiyor (formun
   ilk cocugu gizli csrf kutusu). Islem secici tek sutuna sikisinca tarih
   kutusu sutunu genisletiyor, yanindaki deger kutusu 320 px ekranda
   3 px disari tasiyordu. Islem secici, amaclandigi gibi, tam genislikte. */
@media (max-width: 560px) {
  .newlog { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .newlog > label:first-of-type { grid-column: 1 / -1; }
  .newlog .field { min-width: 0; }
  .newlog .field input { min-width: 0; }
}

/* --- Duzeltme: yem saati kutusu saati kirpiyordu ----------------------------- */

/* style.css saat kutusuna sabit 96 px veriyor ve daralmasina izin
   veriyordu (en az 76 px). Dar yerde "15:3" gibi yarim gorunuyordu;
   saati 12 saatlik (AM/PM) gosteren telefonlarda 96 px zaten yetmiyor.
   Kutu artik iceriginin genisliginde ve daralmiyor. */
.feedrow input[type="time"] {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
}

/* --- Sagdan sola diller --------------------------------------------------- */

html[lang="ar"] .uibtn__desc,
html[lang="ar"] .rem__meta,
html[lang="ar"] .remadd__note {
  direction: rtl;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .uibtn { transition: none; }
}

/* --- v3: bildirimler kapali uyarisi (ana sayfa, butun temalar) --------- */
.pushnag {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 var(--gap, 14px);
  padding: 14px 16px;
  border-radius: var(--radius-sm, 12px);
  background: var(--info-soft, #e6f0fd);
  border: 1px solid var(--info, #2b7fe0);
  color: var(--ink, #16222f);
}
.pushnag[hidden] { display: none; }
.pushnag__icon { flex: none; color: var(--info, #2b7fe0); margin-top: 1px; }
.pushnag__body { flex: 1; min-width: 0; }
.pushnag__text { margin: 0; font-size: .92rem; line-height: 1.45; }
.pushnag__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
}
.pushnag__actions [hidden] { display: none; }
.pushnag__later {
  border: 0;
  background: none;
  padding: 6px 0;
  font: inherit;
  font-size: .86rem;
  color: var(--ink-3, #6b7b8f);
  cursor: pointer;
  text-decoration: underline;
}
.pushnag .pushnag__on { width: auto; margin-top: 0; min-height: 40px; }

/* --- v3: KVKK aydinlatma metni (tablolar, doldurulacak yerler) --------- */
.terms__table {
  overflow-x: auto;
  margin: 0 0 12px;
  -webkit-overflow-scrolling: touch;
}
.terms__table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  line-height: 1.45;
}
.terms__table th,
.terms__table td {
  text-align: left;
  vertical-align: top;
  padding: 7px 8px;
  border-bottom: 1px solid var(--card-line, #e4ebf3);
  overflow-wrap: break-word;
}
.terms__table th {
  color: var(--ink, #16222f);
  font-weight: 700;
  font-size: .78rem;
}
.terms__table tr:last-child td { border-bottom: 0; }
/* Doldurulacak yerler: kolay bulunsun diye hafif isaretli */
.terms .tbd {
  background: var(--warn-soft, #fdf0dc);
  color: var(--ink, #16222f);
  border-radius: 4px;
  padding: 0 3px;
}
/* Ceviri yokken gosterilen Ingilizce metin Arapca sayfada da soldan saga */
html[lang] .terms[dir="ltr"],
html[lang] .terms[dir="ltr"] * {
  direction: ltr;
  text-align: left;
}
/* Telefonda tablo yerine satir satir: her satir bir blok, sutun adi
   degerin onunde kucuk yazilir. */
@media (max-width: 560px) {
  .terms__table tr:first-child { display: none; }
  .terms__table tr {
    display: block;
    padding: 9px 0;
    border-bottom: 1px solid var(--card-line, #e4ebf3);
  }
  .terms__table tr:last-child { border-bottom: 0; }
  .terms__table td {
    display: block;
    border: 0;
    padding: 2px 0;
  }
  .terms__table td:first-child { font-weight: 700; color: var(--ink, #16222f); }
  .terms__table td + td::before {
    content: attr(data-l) ": ";
    font-weight: 600;
    color: var(--ink-3, #7d8b9b);
  }
}

/* --- v3: bakim modu seridi (yonetim paneli) ------------------------------ */
.maintbar {
  margin: 0 0 var(--gap, 14px);
  padding: 12px 14px;
  border-radius: var(--radius-sm, 12px);
  background: var(--warn-soft, #fdf0dc);
  border: 1px solid var(--warn, #d98314);
  color: var(--ink, #16222f);
  font-size: .9rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------
   Premium: logoda "Premium" yazisi, kilitli ozelliklerin notu ve rozeti
   --------------------------------------------------------------------- */
.wordwrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  flex: none;
}
.premword {
  margin-top: 1px;
  color: #1e9fe3;
  font-size: .72rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
html.ui-derin .premword,
html.ui-mercan .premword { color: #4cc1ff; }

.premtag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, #1e9fe3 14%, transparent);
  color: #1678b0;
  font-size: .68rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}
html.ui-derin .premtag,
html.ui-mercan .premtag { color: #7fd3ff; }
[data-theme="dark"] .premtag { color: #7fd3ff; }
[data-theme="dark"] .premword { color: #4cc1ff; }
.premtag svg { width: 11px; height: 11px; flex: none; }

.premnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, #1e9fe3 45%, transparent);
  border-radius: 10px;
  font-size: .86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.premnote a { font-weight: 600; }

.rule.is-premium { opacity: .55; }
.rule__prem { display: inline-flex; margin-left: 6px; }
.segmented__btn.is-premium { opacity: .45; }
.uibtn.is-premium { opacity: .55; cursor: not-allowed; }
.uibtn__prem { display: block; margin-top: 4px; }

/* Premium uzatma kodu */
.premcode { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.premcode input { flex: 1 1 140px; min-width: 0; text-transform: uppercase; }
.premcode__msg { flex-basis: 100%; margin: 4px 0 0; font-size: .82rem; }
.premcode__msg--ok { color: var(--ok, #1a8f4c); }
.premcode__msg--err { color: var(--bad, #c0392b); }

/* Yem plani: yem makinesi ekle baglantisi */
.addfeeder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-weight: 600;
  text-decoration: none;
}
.addfeeder:hover span { text-decoration: underline; }

/* Telefonda "BluCory" yazisi gizli: "Premium" baligin kuyruguna yaklassin
   (biraz yukari, biraz sola). Mercan'da yazi 480 px'te, digerlerinde
   560 px'te gizleniyor. */
@media (max-width: 559px) {
  html:not(.ui-mercan) .premword { position: relative; top: -9px; margin-left: -12px; }
}
@media (max-width: 479px) {
  html.ui-mercan .premword { position: relative; top: -9px; margin-left: -12px; }
}

/* ==========================================================================
   v3: pH modu (priz pH'a gore) ve zorunlu prob bakimi
   ========================================================================== */

/* Mod secici 5'li: Kapali | Termo | pH | Oto | Acik */
form.modeform.segmented { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.segmented__btn--ph.is-active { background: #0f8a7a; }
html.ui-mercan .segmented__btn--ph.is-active { background: var(--polyp, #19c877); color: #0b2b1d; }
@media (max-width: 420px) {
  form.modeform.segmented .segmented__btn { font-size: .74rem; padding-left: 1px; padding-right: 1px; }
}

/* pH kutusu: termostat kutusunun kalibi (kendi sinifi), yesil-mavi vurgu */
.phbox {
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, #0f8a7a 9%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, #0f8a7a 32%, transparent);
  border-left: 3px solid #0f8a7a;
}
.phbox .autopanel__title { margin-bottom: 10px; }
html.ui-derin .phbox { border-radius: 6px; }
html.ui-lagun .phbox { border-left-width: 1px; border-radius: 14px; }
html.ui-mercan .phbox { margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; background: none; }
.phbox .autopanel__lede { margin: -4px 0 10px; font-size: .86rem; }
.phctl__win { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.phctl__lbl { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.phctl__time { width: auto; min-width: 104px; padding: 8px 10px; }
.phctl__dash { color: var(--ink-3); }
.phctl__hint { margin: 10px 0 0; font-size: .82rem; color: var(--ink-2); }
.phcare {
  display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 0;
  padding: 8px 10px; border-radius: 8px; font-size: .84rem; line-height: 1.4;
  background: color-mix(in srgb, var(--ok, #1f9d63) 12%, transparent);
}
.phcare svg { flex: none; margin-top: 2px; }
.phcare a { font-weight: 700; white-space: nowrap; }
.phcare.is-soon { background: color-mix(in srgb, var(--warn, #c98a00) 16%, transparent); }
.phcare.is-late { background: color-mix(in srgb, var(--alert, #d33) 14%, transparent); }

/* Zorunlu hatirlatici */
.rem__tag {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; vertical-align: 1px;
  padding: 2px 7px; border-radius: 999px; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--brand-soft, rgba(18, 114, 184, .12)); color: var(--brand, #1272b8);
}
.rem__why { display: block; margin-top: 3px; font-size: .78rem; color: var(--ink-3); line-height: 1.35; }

/* --- Fotograf yuklenirken (profil, akvaryum): form ustunde bekleme ------- */
form.upform.is-uploading { position: relative; }
form.upform.is-uploading .btn,
form.upform.is-uploading label { pointer-events: none; }
.upbusy {
  position: absolute; inset: -6px; z-index: 6;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(8, 14, 21, .55); color: #fff;
  border-radius: 14px; font-weight: 600; font-size: .95rem;
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
}
.upbusy i {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: bc-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .upbusy i { animation-duration: 1.6s; } }

/* Dokununca acilan alanlar (kullanici adi formu): devre disi gorunmesin */
.tapwrap { position: relative; display: block; }
.tapwrap__cover {
  position: absolute; inset: 0; z-index: 2;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: text; -webkit-tap-highlight-color: transparent;
}
input[data-tapedit]:disabled {
  opacity: 1; color: inherit; -webkit-text-fill-color: currentColor; cursor: text;
}
.tapwrap--pw .tapwrap__cover { right: 48px; }  /* goz dugmesi acikta kalsin */

/* --- v3: cihazsiz uyeye ornek (demo) kutular -----------------------------
   Olcum ve priz kutulari ornek veriyle: icerik soluk ve dokunulamaz,
   baslik okunur, altinda kucuk bir not. Katlanir kutu acilip kapanir. */
.demowrap { position: relative; }
.demowrap .demo { user-select: none; -webkit-user-select: none; }
.demowrap .demo [inert],
.demowrap .demo[inert] { pointer-events: none; }
.demowrap .card > :not(.card__title),
.demowrap .card__title > :not(.demo__note) { opacity: .45; filter: saturate(.55); }
.demowrap--fold .card__title > .card__title-text,
.demowrap--fold .card__title > .card__chevron { opacity: .75; filter: none; }
.demowrap .card__title { flex-wrap: wrap; }
.demo__note {
  flex: 1 1 100%; order: 99;
  margin-top: 2px;
  font-size: .72rem; font-weight: 500; line-height: 1.35; letter-spacing: 0;
  text-transform: none;
  color: var(--muted, #6b7a8c);
}

/* --- v3: cihazsiz uyelik (kayit / giris) --------------------------------- */
.nodev {
  margin: 18px 0 4px; padding: 14px; text-align: center;
  border: 1px dashed var(--card-line, #d5dee8); border-radius: var(--radius-sm, 12px);
}
.nodev__title { margin: 0 0 4px; font-size: 1rem; }
.nodev__lede { margin: 0 0 12px; font-size: .88rem; opacity: .8; line-height: 1.45; }
.nodev__btns { display: flex; flex-direction: column; gap: 8px; }
.nodev__btns .btn, .btn--google { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.orline { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: .82rem; opacity: .7; }
.orline::before, .orline::after { content: ""; flex: 1; height: 1px; background: var(--card-line, #d5dee8); }
.gsign { display: grid; gap: 8px; }
.gsign .btn { width: auto; justify-self: start; }

/* --- v3: Google Play aboneligi -------------------------------------------- */
.playbuy { display: grid; gap: 8px; }
.playbuy .facts__sub { margin: 0; }
.playbuy__btns { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
/* Dugmeler kutunun sagina tam dayali ve esit genislikte; uzun metin
   sigmazsa fiyat alt satira iner. */
.playbuy__btn { width: 100%; display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; column-gap: 8px; row-gap: 2px; text-align: center;
  white-space: normal; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.playbuy__lede { font-weight: 400; }
.playbuy__btn[hidden] { display: none; }
.playbuy__price:empty { display: none; }
.playbuy.is-busy .playbuy__btn { opacity: .55; pointer-events: none; }
.playbuy__msg { margin: 0; font-size: .85rem; }
.playbuy__msg--err { color: var(--alert, #c8373c); }
.playcancel { margin-top: 8px; }
.playcancel .btn { width: auto; }
#playsub dd > span:not(.facts__sub) { display: block; }

/* --------------------------------------------------------------------------
   v3: Enerji olcumu (enerji olcen otomasyon cihazi)
   -------------------------------------------------------------------------- */
.device__watts { margin: 6px 0 0; display: flex; align-items: center; gap: 4px;
  font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.device__watts svg { opacity: .8; }
.plug__watts { display: block; font-size: .68rem; opacity: .75; font-variant-numeric: tabular-nums; margin-top: 1px; }

.energy__lede { margin-bottom: 10px; }
.energy__now { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-2); margin: 0 0 10px; }
.energy__now b { color: var(--ink); font-variant-numeric: tabular-nums; }
.energy__wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.energy { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 320px; }
.energy th, .energy td { padding: 8px 6px; border-bottom: 1px solid var(--card-line); text-align: left; }
.energy thead th { font-size: .74rem; font-weight: 600; color: var(--ink-3); text-transform: none; }
.energy tbody th { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11em; }
.energy__n { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-right: 6px; border-radius: 6px;
  font-size: .72rem; font-weight: 700; background: var(--brand-soft, rgba(0,0,0,.06)); color: var(--brand, inherit); vertical-align: middle; }
.energy .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.energy tfoot th, .energy tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--card-line); }
.energy__note { margin: 10px 0 0; font-size: .82rem; color: var(--ink-3); }

.energyform__price { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9em); gap: 10px; }
.energyform .btn { margin-top: 12px; }

/* --- Klasik tema, dar telefon: ust cubuk duzeltmesi --------------------------
   380 px altinda eski bir kural logoya yazili logonun (wordmark) oranini
   veriyordu; marka kutusu da daralabildigi icin "Premium" yazisi ayarlar
   dismesinin ustune biniyordu. Balik kendi oraninda kucultuldu, marka
   kutusu artik daralmiyor. Wifi yuzdesi logonun altina, balige binmeden
   iniyor. */
@media (max-width: 559px) {
  .topbar__brand { flex: none; }
  .topbar__brand .sigpct { margin-top: 1px; }
}
@media (max-width: 380px) {
  .topbar__brand .topbar__logo { height: 32px; width: calc(32px * 4 / 3); max-width: none; }
  .topbar__brand .premword { top: -7px; margin-left: -10px; font-size: .64rem; }
  .topbar__brand .sigpct { left: 20px; }
}
@media (max-width: 340px) {
  .topbar__brand .wordwrap { display: none; }
}
@media (max-width: 340px) {
  .topbar { gap: 2px; padding-left: 8px; padding-right: 8px; }
  .topbar__user { margin-left: 2px; }
  .topbar__logout { margin-left: 2px; }
}
