/* ==========================================================================
   BluCory - akvaryum kontrol arayuzu
   Tek sutun, alt alta kutular. PC / iOS / Android ayni gorunum.
   ========================================================================== */

/* --- Tema degiskenleri --------------------------------------------------- */

:root {
  --bg:            #eaf0f7;
  --bg-2:          #dfe8f2;
  --card:          #ffffff;
  --card-line:     #e4ebf3;
  --ink:           #16222f;
  --ink-2:         #55677c;
  --ink-3:         #8a9bb0;

  --brand:         #1272b8;
  --brand-soft:    #e3f0fb;

  --ok:            #1f9d63;
  --ok-soft:       #e3f6ec;
  --warn:          #d98314;
  --warn-soft:     #fdf0dc;
  --alert:         #d63b40;
  --alert-soft:    #fdeaea;
  --info:          #2b7fe0;
  --info-soft:     #e6f0fd;

  --track:         #eef2f7;
  --track-ink:     #93a3b6;

  --radius:        18px;
  --radius-sm:     12px;
  --shadow:        0 1px 2px rgba(22, 34, 47, .05), 0 8px 22px rgba(22, 34, 47, .06);
  --logo-filter:   none;

  /* Termometreye gore otomasyon kutusunun zemini */
  --thermo-bg:     #fdeaea;
  --thermo-line:   #eba9a9;
  --stock-bg:      #e6f0fc;
  --stock-line:    #b7d2f0;
  --sched-bg:      #e8f0fa;
  --sched-line:    #b9d0ea;

  --gap:           14px;
  --pad:           18px;
  --maxw:          640px;
}

[data-theme="dark"] {
  --bg:            #0e1721;
  --bg-2:          #0a121a;
  --card:          #1f2c3b;   /* zeminden belirgin sekilde ayrissin */
  --card-line:     #2f3f50;
  --ink:           #e8eef5;
  --ink-2:         #a2b3c6;
  --ink-3:         #71859a;

  --brand:         #4aa8ec;
  --brand-soft:    #16303f;

  --ok:            #45c98a;
  --ok-soft:       #16332a;
  --warn:          #e8a94a;
  --warn-soft:     #38290f;
  --alert:         #f0676b;
  --alert-soft:    #3a1c1e;
  --info:          #61a5f5;
  --info-soft:     #16283f;

  --track:         #16212d;
  --track-ink:     #7d8ea3;

  --shadow:        0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px rgba(0, 0, 0, .28);
  --logo-filter:   invert(1) brightness(1.6);

  --thermo-bg:     #4F1C1C;
  --thermo-line:   #8d3a3a;
  --stock-bg:      #16304d;
  --stock-line:    #2b5480;
  --sched-bg:      #1b2b3d;
  --sched-line:    #2f4a68;
}

/* --- Temel -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* iOS yatay cevirince yaziyi buyutmesin */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;                  /* iOS'ta 16px alti input zoom yapar */
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* v3: renk verilmemis baglantilar tarayicinin mavi / mor (ziyaret
   edilmis) rengiyle cikiyordu. Cevresindeki yaziyla ayni renkte olsun;
   baglanti oldugu alt cizgiden anlasilir. */
a, a:visited {
  color: inherit;
}
a:not([class]) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.ico { display: block; flex: none; }

/* --- Ust bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}

/* Logo dosyalari assets/img altinda: mark-base, mark-arc1..3 ve
   wordmark. Yaylar ayri durdugu icin sinyal gucune gore boyanabiliyor. */
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Balik isareti: taban + uc wifi yayi ayri katmanlar. Yaylar maske
   olarak bindiriliyor, rengi sinyal seviyesi belirliyor. */
.topbar__logo {
  position: relative;
  display: block;
  height: 42px;
  width: calc(42px * 4 / 3);
  flex: none;
}

.topbar__logo-base,
.topbar__arc {
  position: absolute;
  inset: 0;
}

.topbar__logo-base {
  background-image: url("../img/mark-base.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: var(--logo-filter);
}

/* Yaylar maskeyle boyaniyor; taban gibi filtreden gecmiyorlar ki
   sinyal rengi iki temada da ayni kalsin. */
.topbar__arc {
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: .25;
  transition: opacity .25s ease, background-color .25s ease;
}

.topbar__arc--1 {
  -webkit-mask-image: url("../img/mark-arc1.png");
  mask-image: url("../img/mark-arc1.png");
}

.topbar__arc--2 {
  -webkit-mask-image: url("../img/mark-arc2.png");
  mask-image: url("../img/mark-arc2.png");
}

.topbar__arc--3 {
  -webkit-mask-image: url("../img/mark-arc3.png");
  mask-image: url("../img/mark-arc3.png");
}

/* Seviyeye gore hangi yaylarin yanacagi. Renk .wifisig--N kurallarindan
   currentColor ile geliyor, yani ust cubuktaki gosterge ile birebir ayni. */
.topbar__logo.wifisig--1 .topbar__arc--1,
.topbar__logo.wifisig--2 .topbar__arc--1,
.topbar__logo.wifisig--2 .topbar__arc--2,
.topbar__logo.wifisig--3 .topbar__arc--1,
.topbar__logo.wifisig--3 .topbar__arc--2,
.topbar__logo.wifisig--3 .topbar__arc--3 { opacity: 1; }

/* Sinyal yokken yaylar logonun kendi rengine donsun, kirmizi durmasin */
.topbar__logo.wifisig--0 .topbar__arc {
  background-color: var(--ink);
  opacity: .3;
}

/* "BluCory" yazisi - ayri katman, mobilde gizleniyor */
.topbar__word {
  display: block;
  height: 26px;
  width: calc(26px * 169 / 78);
  background-image: url("../img/wordmark.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  filter: var(--logo-filter);
  flex: none;
}

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

/* Kullanici adi - logodan belirgin bir bosluk birakiyor */
a.topbar__user {
  text-decoration: none;
  color: inherit;
  border-radius: 999px;
  padding: 3px 8px 3px 3px;
  transition: background .15s ease;
}

a.topbar__user:hover { background: var(--card); }
a.topbar__user:active { transform: scale(.97); }

.topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  margin-left: 22px;
}

.topbar__avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: .85rem;
}

.topbar__uname {
  font-weight: 700;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__logout {
  margin: 0 auto 0 10px;   /* kullanici adinin yaninda, solda kalsin */
  flex: none;
}

.btn--logout {
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: .86rem;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}

.iconbtn:hover { background: var(--card); color: var(--ink); }
.iconbtn:active { transform: scale(.94); }

/* Ay / gunes: aktif temaya gore hangisi gorunecek */


/* --- Kaydirmali tema anahtari ------------------------------------------- */

.themeswitch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: 58px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--card-line);
  flex: none;

  /* Yuvarlagin kat edecegi yol: genislik - yuvarlak - iki kenar boslugu.
     Sabit 28px yaziliydi, dar ekranda anahtar 50px'e dusunce yuvarlak
     ayin biraz sagina tasiyordu. */
  --knob-travel: calc(58px - 22px - 6px);
}

.themeswitch__ico {
  display: flex;
  z-index: 1;
  transition: color .18s ease, opacity .18s ease;
}

.themeswitch__sun  { margin-right: auto; }
.themeswitch__moon { margin-left: auto; }

/* Kaydiran yuvarlak */
.themeswitch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease;
}

/* Aydinlik: yuvarlak solda (gunesin ustunde), gunes belirgin */
[data-theme="light"] .themeswitch__sun  { color: var(--warn); opacity: 1; }
[data-theme="light"] .themeswitch__moon { color: var(--ink-3); opacity: .5; }
[data-theme="light"] .themeswitch__knob { transform: translateX(0); }

/* Karanlik: yuvarlak sagda (ayin ustunde), ay belirgin */
[data-theme="dark"] .themeswitch__sun  { color: var(--ink-3); opacity: .5; }
[data-theme="dark"] .themeswitch__moon { color: var(--brand); opacity: 1; }
[data-theme="dark"] .themeswitch__knob { transform: translateX(var(--knob-travel)); }

.themeswitch:active .themeswitch__knob { width: 26px; }

/* --- Wifi sinyal gostergesi --------------------------------------------- */

/* Sinyal seviyesinin rengi. Ayri bir wifi simgesi yok; bu siniflar
   logodaki baligin kafasindaki dalgalara currentColor ile geciyor. */
.wifisig--3 { color: var(--ok); }
.wifisig--2 { color: var(--warn); }
.wifisig--1 { color: var(--alert); }
.wifisig--0 { color: var(--ink-3); }

/* --- Sayfa govdesi ------------------------------------------------------ */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Ince serit, altindaki kutuya biraz daha yaklassin */
.card--vidoff { margin-bottom: -4px; }

/* --- Kutu (kart) -------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}

.card--slim { padding: 12px 14px; }

/* --- Katlanabilir kart --------------------------------------------------- */

.card--fold { padding: 0; }

.card__title--fold {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px var(--pad);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: var(--radius);
  transition: background .15s ease;
}

.card__title--fold::-webkit-details-marker { display: none; }

.card__title--fold:hover { background: var(--track); }

.card__title-text {
  flex: 1;
  text-align: left;
  font-size: 1.12rem;
}

.card__chevron {
  display: flex;
  flex: none;
  color: var(--ink-3);
  transition: transform .2s ease;
}

.card--fold[open] > .card__title--fold .card__chevron { transform: rotate(180deg); }

.card--fold[open] > .card__title--fold {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--card-line);
}

.card__body { padding: 18px var(--pad) var(--pad); }

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

.card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 16px;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.card__title-icon { color: var(--brand); display: flex; }

/* --- Formlar ------------------------------------------------------------ */

.lede {
  margin: -6px 0 18px;
  color: var(--ink-2);
  font-size: .93rem;
  line-height: 1.6;
}

.lede--note {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
  font-size: .86rem;
  color: var(--ink-2);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
}

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

.field input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;              /* iOS zoom yapmasin */
  font-family: inherit;
  color: var(--ink);
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, background .15s ease;
}

.field input:focus {
  outline: none;
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Acilir liste - metin alanlariyla ayni gorunum */
.select {
  width: 100%;
  padding: 13px 38px 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background-color: var(--track);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
  /* Ok isareti: ayri dosya istemesin diye gomulu SVG */
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355677c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5 12 15l6-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
}

.select:focus {
  outline: none;
  background-color: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field input.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.field input::placeholder { color: var(--ink-3); opacity: .7; }

/* Sifreyi goster / gizle */
.field__wrap {
  position: relative;
  display: flex;
}

.field__wrap input { padding-right: 48px; }

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--ink-3);
  transition: color .15s ease, background .15s ease;
}

.reveal:hover { color: var(--brand); background: var(--brand-soft); }
.reveal[aria-pressed="true"] { color: var(--brand); }

/* Tarayicilarin kendi goz simgesi ikinci kez cikmasin */
.field input::-ms-reveal,
.field input::-ms-clear { display: none; }

/* Alanin kendi hata mesaji */
.field__err {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--alert);
  line-height: 1.4;
}

.field__err .bi__en {
  font-weight: 500;
  color: var(--alert);
  opacity: .75;
}

.field--bad input,
.field--bad select {
  border-color: var(--alert);
  background: var(--alert-soft);
}

.field--bad input:focus {
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-soft);
}

.field--bad .field__hint { display: none; }

/* Onay kutusu */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--brand);
  margin: 0;
}

/* Butonlar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  transition: filter .15s ease, background .15s ease;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  width: 100%;
  margin-top: 4px;
}

.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:active { filter: brightness(.94); }

.btn--ghost {
  min-height: 38px;
  padding: 8px 14px;
  font-size: .9rem;
  color: var(--ink-2);
  border: 1px solid var(--card-line);
}

.btn--ghost:hover { color: var(--alert); border-color: var(--alert); }

/* --- Yonlendirme kutusu (giris <-> kayit) -------------------------------- */

.cta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--card-line);
  text-align: center;
}

.cta__text {
  margin: 0 0 12px;
  font-size: .95rem;
  color: var(--ink-2);
  line-height: 1.35;
}

.cta__text .bi__en { color: var(--ink-3); }

.btn--outline {
  width: 100%;
  gap: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 2px solid var(--brand);
}

.btn--outline .bi__en { color: inherit; opacity: .75; }

.btn--outline:hover { background: var(--brand); color: #fff; }
.btn--outline:hover .bi__en { opacity: .85; }
.btn--outline:active { transform: scale(.99); }

/* Form alti link */
.formlink {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--card-line);
  text-align: center;
  font-size: .92rem;
  color: var(--ink-2);
}

.formlink > a:only-child { display: inline-block; padding: 4px 8px; }

.formlink a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.formlink a:hover { text-decoration: underline; }

/* Hata kutusu */
.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--alert-soft);
  border: 1px solid var(--alert);
  color: var(--alert);
  font-size: .9rem;
  line-height: 1.5;
}

.alert p { margin: 0; }
.alert p + p { margin-top: 6px; }

/* Yonlendirme sonrasi bolume donerken ust bar yaziyi ortmesin */
.anchor {
  display: block;
  height: 0;
  scroll-margin-top: 84px;
}

/* Form icindeki mesajlar formun bir parcasi gibi dursun */
.form .alert,
#langForm .alert {
  margin-bottom: 4px;
  font-size: .88rem;
}

.alert--ok {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

/* --- Iki dilli metin ----------------------------------------------------- */

.bi { display: inline-block; }

.bi__tr { display: block; }

/* Ingilizcesi bir tik kucuk ve soluk: hangisinin ikincil oldugu belli olsun,
   ama okunamayacak kadar da silik degil. */
.bi__en {
  display: block;
  margin-top: 1px;
  font-size: .82em;
  font-weight: 500;
  color: var(--ink-3);
  font-style: italic;
}

.btn .bi__en,
.check .bi__en { color: inherit; opacity: .72; font-style: normal; }

.btn .bi { line-height: 1.25; }


/* Kart basliginin altindaki ikinci dil */
.card__sub {
  margin: -12px 0 16px;
  text-align: center;
  font-size: .92rem;
  font-style: italic;
  color: var(--ink-3);
}

/* Ikinci dildeki aciklama paragrafi */
.lede--en {
  margin-top: -12px;
  font-size: .86rem;
  font-style: italic;
  color: var(--ink-3);
}

/* --- Dil secimi ---------------------------------------------------------- */

.langgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.langbtn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px 12px;
  min-height: 92px;
  border: 2px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--track);
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}

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

.langbtn:hover { border-color: var(--brand); }
.langbtn:active { transform: scale(.97); }

.langbtn__flag { display: flex; }

.langbtn__name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.2;
}

/* Secili dil */
.langbtn.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.langbtn.is-on .langbtn__name { color: var(--brand); }

/* Klavyeyle gezerken cerceve gorunsun */
.langbtn input:focus-visible + .langbtn__flag {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Henuz hazir olmayan diller */
.langbtn.is-soon {
  cursor: not-allowed;
  opacity: .5;
}

.langbtn.is-soon:hover { border-color: var(--card-line); }
.langbtn.is-soon:active { transform: none; }

.langbtn__soon {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 560px) {
  .langgrid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .langgrid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Profil fotografi ---------------------------------------------------- */

.avatarbox {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatarbox__pic {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.9rem;
  font-weight: 800;
  border: 2px solid var(--card-line);
}

.avatarbox__pic--img { object-fit: cover; }

.avatarbox__side {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

/* Dosya secme dugmesi: gercek input gizli, etiket buton gibi davraniyor */
.btn--pick {
  position: relative;
  width: auto;
  min-height: 40px;
  padding: 8px 14px;
  font-size: .9rem;
  overflow: hidden;
}

.btn--pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.avatarbox__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatarbox__actions .btn--primary { flex: 1; margin-top: 0; }

/* Ust bardaki fotograf */
.topbar__avatar--img {
  object-fit: cover;
  border: 1px solid var(--card-line);
}

@media (max-width: 380px) {
  .avatarbox__pic { width: 62px; height: 62px; font-size: 1.5rem; }
  .avatarbox { gap: 12px; }
}

/* --- Degistirilemeyen hesap bilgisi -------------------------------------- */

.whoami {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
}

.whoami__label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-2);
}

.whoami__value {
  font-weight: 700;
  text-align: right;
}

.whoami__note {
  margin: 8px 2px 0;
  font-size: .78rem;
  color: var(--ink-3);
}

/* Ayarlar sayfasindaki form ayraci */
/* Ayarlar sayfasindaki ayirici cizgi. Yalnizca <hr> ogesine uygulanmali:
   otomasyon panelindeki .rule satirlariyla ayni sinif adini paylasiyor. */
hr.rule {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--card-line);
}

.form--tight { gap: 12px; }

/* Ust bardaki ayar carki bir baglanti; alti cizili gorunmesin */
a.iconbtn { text-decoration: none; }

/* --- Ilk kurulum adimlari ------------------------------------------------ */

.setup {
  margin: 0 0 18px;
  padding: 14px 16px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-color: var(--card-line);
}

/* Ac/kapa basligi */
.setup__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: var(--brand);
  cursor: pointer;
  list-style: none;          /* Firefox'un ucgen isareti */
  user-select: none;
}

/* Safari ve Chrome'un varsayilan ucgeni */
.setup__title::-webkit-details-marker { display: none; }

.setup__title .ico {
  flex: none;
  transition: transform .18s ease;
}

.setup[open] .setup__title .ico { transform: rotate(180deg); }

.setup[open] .setup__title { margin-bottom: 10px; }

.setup__intro {
  margin: 0 0 10px;
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.55;
}

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

.setup__steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.setup__steps::marker,
.setup__steps li::marker {
  color: var(--brand);
  font-weight: 700;
}

.setup__note {
  margin: 12px 0 0;
  font-size: .8rem;
  color: var(--ink-3);
}

/* Metin icinde gecen ag adi / sifre */
.chip {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 1px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--card-line);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* --- Wi-Fi slotlari ------------------------------------------------------ */

.wifi {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--track);
}

.wifi__no {
  padding: 0 6px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--brand);
}

.wifi .field input { background: var(--card); }

/* --- Sensor esikleri ----------------------------------------------------- */

.sgroup + .sgroup { margin-top: 20px; }

.sgroup__title {
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 800;
}

.sgroup__title--temp { color: var(--warn); }
.sgroup__title--ph   { color: var(--info); }
.sgroup__title--tds  { color: var(--ok); }

.srow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.srow + .srow { border-top: 1px solid var(--card-line); }

.srow__label {
  color: var(--ink-2);
  font-size: .93rem;
  margin-right: auto;
}

.srow__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

/* Kilitliyken kutu gibi degil, duz yazi gibi gorunsun */
.srow__input {
  width: 4.6em;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
}

.srow__input::-webkit-outer-spin-button,
.srow__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.srow__input:read-only { cursor: default; }

.srow.is-editing .srow__input {
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

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

.srow__edit {
  display: inline-flex;
  padding: 5px;
  border-radius: 8px;
  color: var(--info);
}

.srow__edit:hover { background: var(--info-soft); }
.srow.is-editing .srow__edit { color: var(--ok); }

/* Yukari / asagi ok tuslari - gorunurlugu JS ayarliyor */
.spin {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.spin__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 21px;
  border: 1px solid var(--card-line);
  border-radius: 7px;
  background: var(--track);
  color: var(--ink-2);
}

.spin__btn:hover { color: var(--brand); border-color: var(--brand); }
.spin__btn:active { background: var(--brand-soft); }

@media (max-width: 380px) {
  .srow__label { font-size: .86rem; }
  .srow__input { width: 4.1em; }
}

/* --- Anahtar (ON/OFF) --------------------------------------------------- */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 54px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--card-line);
  transition: background .18s ease, border-color .18s ease;
}

.switch__text {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--track-ink);
  margin-right: auto;
  padding-left: 1px;
  transition: color .18s ease;
}

.switch__knob {
  position: absolute;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
  transform: translateX(0);
}

.switch:not(.is-on) .switch__knob { transform: translateX(-26px); }
.switch:not(.is-on) .switch__text { margin-right: 0; margin-left: auto; padding-right: 2px; }

.switch.is-on {
  background: var(--ok-soft);
  border-color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

.switch.is-on .switch__text { color: var(--ok); }

/* --- Olcum kutucuklari -------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Dort kutucuk 2x2 oturuyor; degerler uzun oldugunda tasmasin */
.stat__value { min-width: 0; }

.stat {
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  padding: 14px 10px;
  text-align: center;
}

.stat__value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* Sensor yoksa deger yerine kucuk aciklama */
.stat__note {
  margin-top: 4px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1.3;
}

.stat__label {
  margin-top: 2px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
}

/* Ust sinirda veya uzerinde */
.stat--alert { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }

/* Alt sinirda veya altinda */
.stat--cold  { background: var(--info-soft);  border-color: var(--info);  color: var(--info); }

.stat--warn  { background: var(--warn-soft);  border-color: var(--warn);  color: var(--warn); }
.stat--ok    { background: var(--ok-soft);    border-color: var(--ok); color: var(--ok); }
.stat--ok    { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.stat--plain { background: var(--track); border-color: var(--card-line); }

.stat--alert .stat__label,
.stat--cold  .stat__label,
.stat--warn  .stat__label,
.stat--ok    .stat__label { color: inherit; opacity: .85; }

/* Sinir asildiginda simge hafifce nabiz atsin - goz oraya gitsin */
.stat--alert .stat__icon,
.stat--cold  .stat__icon { animation: bc-pulse .9s ease-in-out infinite; }

@keyframes bc-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  45%      { opacity: .5;  transform: scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .stat--alert .stat__icon,
  .stat--cold  .stat__icon { animation: none; }
}

/* --- Baglanti durumu ---------------------------------------------------- */

.online {
  margin: 14px 0 2px;
  text-align: center;
  font-size: .84rem;
  color: var(--ink-3);
  line-height: 1.7;
}

.online b { color: var(--ink-2); }

/* --- Video kutusu -------------------------------------------------------- */

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}

/* aspect-ratio desteklemeyen eski tarayicilar icin yedek */
@supports not (aspect-ratio: 16 / 9) {
  .video { height: 0; padding-bottom: 56.25%; }
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Kaynak secili ama bilgi eksikse */
.video--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 20px;
  aspect-ratio: auto;
  min-height: 150px;
  background: var(--track);
  border: 1px dashed var(--card-line);
}

.video--empty p {
  margin: 0;
  max-width: 34em;
  text-align: center;
  font-size: .92rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.video--empty .btn--outline { width: auto; }

.video__note {
  margin: -6px 0 12px;
  text-align: center;
  font-size: .78rem;
  color: var(--ink-3);
}

.videobar { margin: 0; }

/* Video kapaliyken kutu ince bir seride insin: kullanmayan kisi
   ekranin tepesini bosuna harcamasin. */
.card--vidoff {
  padding: 2px;
  border-radius: 999px;
}

.card--vidoff .segmented--video {
  padding: 0;
  background: none;
}

.card--vidoff .segmented--video .segmented__btn {
  min-height: 22px;
  padding: 2px 4px;
  font-size: .62rem;
  letter-spacing: .02em;
}

/* Kaynak secim seridi */
.segmented--video {
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.segmented--video .segmented__btn {
  border-radius: 999px;
  min-height: 38px;
  padding: 9px 4px;
  font-size: .78rem;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.segmented--video .segmented__btn--voff.is-active     { background: var(--ink-2); }
.segmented--video .segmented__btn--vvideo.is-active   { background: #c4302b; }
.segmented--video .segmented__btn--vchannel.is-active { background: #9b1c17; }
.segmented--video .segmented__btn--vtwitch.is-active  { background: #7b3fe4; }

@media (max-width: 430px) {
  .segmented--video .segmented__btn { font-size: .68rem; padding: 9px 2px; }
  .card--vidoff .segmented--video .segmented__btn { font-size: .56rem; padding: 2px 1px; }
}

/* --- Cihaz satiri ------------------------------------------------------- */

/* Prizler arasinda rahat bir bosluk: alt alta alti satir var,
   bitisikken hangi mod butonunun hangi prize ait oldugu karisiyordu.
   Ayirici cizginin iki yaninda 35'er piksel, toplam 70 piksel. */
.device { padding: 35px 0 35px; }
.device:first-child { padding-top: 6px; }
.device:last-child { padding-bottom: 4px; }
.device + .device { border-top: 1px solid var(--card-line); }

.device__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.device__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.02rem;
  min-width: 0;
}

/* Priz numarasi: ikon yerine sira numarasi, cihazin uzerindeki
   etiketle birebir eslesiyor */
.device__num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.device__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device__icon { color: var(--brand); display: flex; }

/* --- Priz durum rozeti --------------------------------------------------- */

/* Tiklanamaz; imlec de degismiyor ki buton sanilmasin.
   Renk yalnizca akim durumunu anlatiyor: yesil acik, kirmizi kapali.
   Karari kimin verdigi simge ve yaziyla belli oluyor. */
.pstate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
}

.pstate__icon { display: flex; }

.pstate__text {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
}

.pstate__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

/* Acik */
.pstate--on {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.pstate--on .pstate__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

/* Kapali */
.pstate--off {
  background: var(--alert-soft);
  border-color: var(--alert);
  color: var(--alert);
}

.pstate--off .pstate__dot {
  background: var(--alert);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alert) 25%, transparent);
}

/* Ekran okuyucular icin tam metin */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 430px) {
  .pstate__text { display: none; }
  .pstate { padding: 5px 8px; }
}

/* --- Akvaryum bilgileri -------------------------------------------------- */

.tankphoto {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.tankphoto__img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-line);
  display: block;
}

.tankphoto__empty {
  display: grid;
  place-items: center;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--card-line);
  background: var(--track);
  color: var(--ink-3);
}

.tankphoto__side {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tankphoto__actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.tankphoto__actions .btn { width: auto; min-height: 34px; margin-top: 0;
  padding: 6px 14px; font-size: .86rem; }

.tank__head {
  margin: 22px 0 10px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--brand);
}

.tankgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* --- Ekipman satirlari --- */

.equip {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--track);
  border: 1px solid var(--card-line);
}

.equip__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.equip__state {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: .85rem;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equip__name {
  flex: none;
  font-weight: 700;
  font-size: .95rem;
}

/* Dikkat: bu select artik dikey bir flex kutunun icinde. Eskiden
   yatay satirdayken verilen flex-basis, dikey eksende yukseklik
   olarak uygulanip kutuyu kocaman gosteriyordu. */
.equip__present {
  width: 100%;
  padding-top: 9px;
  padding-bottom: 9px;
  background-color: var(--card);
}

.equip__fields {
  display: grid;
  grid-template-columns: 74px 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.equip__fields .select { padding-top: 9px; padding-bottom: 9px; }

.equip__fields .field--wide { grid-column: 1 / -1; }

.equip__fields .field input { background: var(--card); }

/* Adet alani dar ve ortali */
.field--qty input { text-align: center; font-variant-numeric: tabular-nums; }

/* "Yok" secilince detay alanlari gizleniyor */
.equip.is-none .equip__fields { display: none; }

/* --- Bolum basligi ve duzenle dugmesi --- */

.sect__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sect__head .tank__head { margin-bottom: 6px; }

/* Yalnizca kalem: yazi olmadan da ne yaptigi belli */
.iconedit {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  color: var(--info);
}

.iconedit:hover { background: var(--info-soft); }

.sect__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Bu bolumdeki dugmeler daha kucuk */
.btn--sm {
  width: auto;
  min-height: 34px;
  margin-top: 0;
  padding: 6px 14px;
  font-size: .86rem;
}

.facts {
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.facts__row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--card-line);
}

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

.facts dt {
  flex: 0 0 42%;
  font-size: .85rem;
  color: var(--ink-2);
}

.facts dd {
  flex: 1;
  margin: 0;
  min-width: 0;
  font-weight: 600;
  word-break: break-word;
}

.facts__no { color: var(--ink-3); font-weight: 400; }

/* --- Diger ekipmanlar --- */

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

.otheritem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--track);
  border: 1px solid var(--card-line);
}

.otheritem__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
}

.otheritem__detail { font-size: .84rem; color: var(--ink-2); }

.otheradd {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
}

.otheradd .btn { width: auto; margin-top: 0; }

.otheradd input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}

.otheradd input:focus {
  outline: none;
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.tank__save { margin-top: 18px; }

.tankgrid--sub { grid-template-columns: 1fr 1fr; }
.tankgrid .field--wide { grid-column: 1 / -1; }

@media (max-width: 560px) {
  .tankgrid, .tankgrid--sub { grid-template-columns: 1fr 1fr; }
  .otheradd { grid-template-columns: 1fr; }
  .equip__fields { grid-template-columns: 74px 1fr; }
  .facts dt { flex-basis: 45%; }
}

/* --- Canlilar ------------------------------------------------------------ */

.newstock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--card-line);
}

.newstock .field--wide { grid-column: 1 / -1; }
.newstock__add { grid-column: 1 / -1; width: 100%; }

.newstock input[type="date"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}

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

/* Akvaryumda su an bulunanlar mavi zeminde: gecmis listesinden
   ve sayfadaki diger listelerden ayrissin. */
.stock {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--stock-bg);
  border: 1px solid var(--stock-line);
  border-left: 3px solid var(--brand);
}

.stock__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.stock__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.stock__name { font-size: .98rem; }

.stock__qty {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .76rem;
  font-weight: 800;
}

.stock__meta {
  flex: 1 1 100%;
  font-size: .8rem;
  color: var(--ink-3);
  line-height: 1.5;
}

/* Adet azaltma formu */
.stockcut {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--card-line);
}

.stockcut[hidden] { display: none; }
.stockcut .sect__actions { grid-column: 1 / -1; margin-top: 2px; }

.stockcut input,
.stockcut .select {
  background-color: var(--card);
  padding-top: 10px;
  padding-bottom: 10px;
}

.stockcut input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}

/* Gecmis: daha sonuk ve kucuk */
.stocks--past { gap: 5px; }

.stock--past {
  padding: 7px 11px;
  opacity: .75;
  background: var(--track);
  border: 1px solid var(--card-line);
  border-left: 1px solid var(--card-line);
}

.stock--past b { font-size: .84rem; font-weight: 700; }
.stock--past .stock__meta { font-size: .74rem; }

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

/* Disa aktarim baglantisi */
.export {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
}

.export .btn--outline { width: auto; gap: 8px; }

/* --- Akvaryum asistani ---------------------------------------------------- */

.assist {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--card-line));
  border-left: 3px solid var(--brand);
}

/* color-mix desteklemeyen tarayici icin yedek */
@supports not (background: color-mix(in srgb, red 10%, blue)) {
  .assist { border-color: var(--card-line); }
}

.assist__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.assist__kind {
  font-size: .95rem;
  font-weight: 800;
  color: var(--brand);
}

.assist__date {
  font-size: .76rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.assist__body {
  margin: 0;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink);
}

.assist__note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--card-line);
  font-size: .76rem;
  color: var(--ink-3);
  line-height: 1.5;
}

/* --- Bakim kayitlari ----------------------------------------------------- */

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

.logs__empty { margin-top: 18px; }

.logs li { margin: 0; }

.logrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--track);
  border: 1px solid var(--card-line);
}

/* Ilk on kayittan sonrasi kucuk yaziyla: gecmis erisilebilir kalsin
   ama son islemler one ciksin. */
.logrow--small {
  padding: 6px 10px;
  gap: 2px 8px;
  opacity: .8;
}

.logrow--small .logrow__kind { font-size: .78rem; }
.logrow--small .logrow__when { font-size: .68rem; }
.logrow--small .logrow__note { font-size: .72rem; }
.logrow--small .logrow__lt   { font-size: .64rem; padding: 0 5px; }

.logrow__kind {
  font-weight: 700;
  font-size: .92rem;
}

.logrow__lt {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--info);
  font-size: .72rem;
  font-weight: 800;
}

.logrow__when {
  font-size: .78rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.logrow__note {
  flex: 1 1 100%;
  font-size: .84rem;
  color: var(--ink-2);
  line-height: 1.45;
}

/* Yeni kayit formu */
.newlog {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  gap: 12px;
  align-items: end;
  padding-top: 16px;
  border-top: 1px dashed var(--card-line);
}

.newlog .field { margin: 0; }
.newlog__note { grid-column: 1 / -1; }

.newlog__add {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}

/* Litre alani yalnizca su islemlerinde gorunuyor */
.newlog .field.is-hidden { display: none; }

/* Litre alani gizliyken iki sutun */
.newlog.no-liters { grid-template-columns: 1fr 1fr; }

.newlog input[type="datetime-local"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}

.newlog input[type="datetime-local"]:focus {
  outline: none;
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

@media (max-width: 560px) {
  .newlog { grid-template-columns: 1fr 1fr; }
  .newlog .field:first-child { grid-column: 1 / -1; }
}

/* --- Otomasyon paneli ---------------------------------------------------- */

.autopanel {
  margin: 12px 0 4px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
}

.autopanel[hidden] { display: none; }

.autopanel__title {
  margin: 0 0 4px;
  font-size: .92rem;
  font-weight: 800;
  color: var(--brand);
}

.autopanel__lede,
.autopanel__empty,
.autopanel__full {
  margin: 0 0 12px;
  font-size: .82rem;
  color: var(--ink-3);
  line-height: 1.5;
}

.autopanel__full { color: var(--warn); }

/* --- Sicaklik sarti --- */


.thermobox .autopanel__title { margin-bottom: 10px; }

/* Baslik ve satiri saran kutu. Saat kurallarindan ayrissin diye
   ayri bir zemin ve sol kenarda kirmizi vurgu. */
.thermobox {
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: var(--thermo-bg);
  border: 1px solid var(--thermo-line);
  border-left: 3px solid var(--alert);
}

/* Zamana gore otomasyon: ayni kalipta, mavi tonda kutu */
.schedbox {
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  border-radius: 10px;
  background: var(--sched-bg);
  border: 1px solid var(--sched-line);
  border-left: 3px solid var(--brand);
}

.schedbox .autopanel__title { margin-bottom: 6px; }
.schedbox .autopanel__lede  { margin-bottom: 12px; }
.schedbox .rules            { margin-bottom: 0; }
.schedbox .autopanel__empty { margin-bottom: 0; }

.thermobox .autopanel__title { margin-bottom: 10px; }

.thermo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

/* Kural kapaliyken alanlar soluk ama okunabilir kalsin */
.thermo.is-off .thermo__dir,
.thermo.is-off .thermo__num { opacity: .55; }

.thermo__dir {
  flex: 1 1 200px;
  min-width: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: var(--track);
}

.thermo__num {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 104px;
  padding-right: 10px;
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: 10px;
}

.thermo__num input {
  width: 100%;
  min-width: 0;
  padding: 10px 0 10px 12px;
  min-width: 3.6em;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}

.thermo__num input:focus { outline: none; }

.thermo__num:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.thermo__unit {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
}

/* Sicaklik alanindaki ok tuslari */
.spin--thermo {
  flex: none;
  margin: 2px 2px 2px 0;
  gap: 1px;
}

.spin--thermo .spin__btn {
  width: 20px;
  height: 14px;
  border-radius: 5px;
  background: var(--card);
}

.spin--thermo .ico { width: 11px; height: 11px; }

.thermo .ruleswitch { flex: none; }

.thermo__save { width: auto; margin-top: 0; }

@media (max-width: 430px) {
  .thermo__dir { flex: 1 1 100%; }
}

/* --- Kural listesi --- */

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

.rules li { margin: 0; }

.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-line);
}

/* Kapali kural soluk dursun ama okunabilir kalsin */
.rule.is-off { opacity: .55; }

.rule__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rule__days {
  font-size: .8rem;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule__times {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .98rem;
  font-variant-numeric: tabular-nums;
}

.rule__arrow { display: flex; color: var(--ink-3); }

.rule__over {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .66rem;
  font-weight: 700;
}

.rule__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.rule__form { margin: 0; display: flex; }

/* Kuralin aktiflik anahtari */
.ruleswitch {
  position: relative;
  display: inline-block;
  cursor: pointer;
  display: inline-block;
  cursor: pointer;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--card-line);
  transition: background .18s ease, border-color .18s ease;
}

/* Etiket olarak kullanildiginda icindeki kutucuk gizli kalir */
.ruleswitch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.ruleswitch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.ruleswitch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: transform .18s ease, background .18s ease;
}

.ruleswitch.is-on {
  background: var(--ok-soft);
  border-color: var(--ok);
}

.ruleswitch.is-on .ruleswitch__knob,
.ruleswitch input:checked ~ .ruleswitch__knob {
  transform: translateX(18px);
  background: var(--ok);
}

.ruleswitch:has(input:checked) {
  background: var(--ok-soft);
  border-color: var(--ok);
}

.ruleswitch input:focus-visible ~ .ruleswitch__knob {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.rule__del {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ink-3);
}

.rule__del:hover { color: var(--alert); background: var(--alert-soft); }

/* --- Yeni kural formu --- */

.newrule {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--card-line);
}

.newrule__label {
  display: block;
  margin-bottom: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-2);
}

.daypicker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.daychip {
  position: relative;
  display: block;
  cursor: pointer;
  user-select: none;
}

.daychip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.daychip span {
  display: grid;
  place-items: center;
  padding: 8px 2px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--card-line);
  color: var(--ink-3);
  font-size: .72rem;
  font-weight: 700;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.daychip input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.daychip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.preset {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  background: var(--card);
  color: var(--ink-2);
  font-size: .74rem;
  font-weight: 600;
}

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

.newrule__times {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.newrule__time {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 110px;
  min-width: 0;
}

.newrule__time span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-2);
}

.newrule__time input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}

.newrule__time input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Safari saat alanini kendi bicimiyle ciziyor; hizalamayi bozmasin */
.newrule__time input::-webkit-date-and-time-value { text-align: left; }

.newrule__add {
  width: auto;
  flex: none;
  min-height: 42px;
  margin-top: 0;
  padding: 10px 18px;
}

@media (max-width: 430px) {
  .newrule__add { width: 100%; }
  .rule__days { font-size: .74rem; }
}

/* --- Priz adi degistirme ------------------------------------------------- */

.rename {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.rename[hidden] { display: none; }

.rename__input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 9px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px var(--brand-soft);
  -webkit-appearance: none;
  appearance: none;
}

.rename__input:focus { outline: none; }

.rename__ok,
.rename__no {
  width: auto;
  min-height: 38px;
  margin-top: 0;
  padding: 8px 14px;
  font-size: .88rem;
  flex: none;
}

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

.device__rename {
  display: inline-flex;
  padding: 4px;
  border-radius: 8px;
  color: var(--ink-3);
}

.device__rename:hover { color: var(--brand); background: var(--brand-soft); }

.device__tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.device__auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand);
}

.device__auto:hover { background: var(--brand-soft); }

.device__auto.is-open {
  background: var(--brand);
  color: #fff;
}

/* --- 4'lu mod secici ---------------------------------------------------- */

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--track);
  border-radius: 12px;
  overflow: hidden;
}

.segmented__btn {
  padding: 13px 4px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--track-ink);
  transition: background .16s ease, color .16s ease;
  min-height: 46px;                 /* dokunma alani */
}

.segmented__btn:hover { color: var(--ink); }

.segmented__btn.is-active { color: #fff; }

.segmented__btn--off.is-active    { background: var(--alert); }
.segmented__btn--thermo.is-active { background: var(--warn); }
.segmented__btn--auto.is-active   { background: var(--info); }
.segmented__btn--on.is-active     { background: var(--ok); }

/* --- Alt bilgi ---------------------------------------------------------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px calc(22px + env(safe-area-inset-bottom));
  font-size: .78rem;
  color: var(--ink-3);
}

.foot__sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
}

/* --- Kucuk ekran -------------------------------------------------------- */

/* Telefon: cikis butonu yaziyi birakip simgeye dusuyor */
@media (max-width: 560px) {
  .btn--logout span { display: none; }
  .btn--logout { padding: 6px 9px; }
  .topbar__user { margin-left: 14px; }
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .iconbtn { width: 38px; height: 38px; }
}

/* Dar telefon: kullanici adi yazisi gidiyor, avatar harfi kaliyor */
@media (max-width: 430px) {
  .topbar__uname { display: none; }
  .topbar__user { margin-left: 10px; }
}

@media (max-width: 380px) {
  :root { --pad: 14px; }
  .topbar__logo { height: 34px; width: calc(34px * 440 / 146); }
  .stat__value { font-size: 1.45rem; }
  .segmented__btn { font-size: .76rem; padding: 12px 2px; }
  .device__auto span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}




.topbar__user {
  flex: none;
  overflow: visible;
}

.topbar__brand {
  flex: 0 1 auto;
  min-width: 0;
}

.topbar__logo {
  max-width: 100%;
}

.topbar__uname {
  max-width: 40vw;
}

/* --- 2. Dar ekranda ust cubugu sikilastir -------------------------------- */

@media (max-width: 430px) {
  .topbar {
    gap: 4px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar__user   { margin-left: 4px; padding-right: 5px; }
  .topbar__logout { margin-left: 4px; }
  .themeswitch {
    width: 50px;
    height: 28px;
    padding: 0 5px;
    --knob-travel: calc(50px - 22px - 6px);
  }
  .iconbtn        { width: 34px; height: 34px; }
}

/* --- 3. Genel olcek ------------------------------------------------------ */


@media (max-width: 560px) {
  html { font-size: 15px; }
  body { font-size: 1rem; }

  :root {
    --pad:    14px;
    --gap:    11px;
    --radius: 14px;
  }

  input, select, textarea, .select, .input {
    font-size: 16px;
  }

  /* Simgeler px ile basildigi icin yaziyla birlikte kuculmuyorlardi.
     En gozle gorunenleri em'e cevirdik. */
  .card__title-icon .ico { width: 1.25em; height: 1.25em; }
  .stat__icon .ico       { width: 1.05em; height: 1.05em; }
  .iconedit .ico         { width: 1em;    height: 1em; }
  .device__auto .ico     { width: 1em;    height: 1em; }
  .card__chevron .ico    { width: 1.1em;  height: 1.1em; }
}

@media (max-width: 380px) {
  html { font-size: 14px; }
  :root { --pad: 12px; --gap: 10px; }
}


/* --- Satir ici duzenleme (akvaryum olculeri) ----------------------------- */

/* Ozet ve form ayni satirlari paylasiyor: metin gizlenince yerine
   giris kutusu geliyor, satirlar yerinden oynamiyor. */

.factform .facts dd {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.factform .facts__in {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 210px;
  padding: 7px 10px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* iOS odaklaninca yakinlastirmasin */
  font-weight: 600;
}

.factform .facts__in:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.factform select.facts__in {
  max-width: 100%;
  font-weight: 600;
}

.factform .facts__hint {
  flex: 1 0 100%;
  font-size: .78rem;
  font-weight: 400;
  color: var(--ink-3);
}

.factform.is-editing .facts__row {
  padding: 5px 0;
}

.factform .sect__actions {
  margin-top: 12px;
}

/* Duzenleme acikken kalem isaretli dursun */
.iconedit.is-on {
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

/* [hidden] her zaman gizlesin. Grid/flex tanimli kutularda tarayicinin
   varsayilan display:none kurali eziliyordu (ornegin .equip__fields). */
[hidden] { display: none !important; }

/* --- Kart sabitleme dugmesi ---------------------------------------------- */

.card__pin {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--ink-3);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.card__pin:hover { background: var(--track); color: var(--ink-2); }
.card__pin:active { transform: scale(.92); }

/* Sabitlenmis hali belirgin olsun: dolu zemin, beyaz ikon ve
   yana yatmis bir pin. */
.card__pin.is-on {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 1px 3px rgba(18, 114, 184, .45);
}

.card__pin.is-on:hover {
  color: #fff;
  background: var(--brand);
}

.card__pin .ico { transition: transform .18s ease; }
.card__pin.is-on .ico { transform: rotate(-40deg); }

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

/* Canlilar kutusu: adet kurali notu, gecmis listesinden ayrilsin */
.stocks--past + .lede--note,
.stocks + .lede--note,
.autopanel__empty + .lede--note {
  margin-top: 22px;
}

/* Acik temada tema anahtari zeminden ayrissin: --track ile --bg
   birbirine cok yakin, dugme sayfaya karisiyordu. */
[data-theme="light"] .themeswitch {
  background: var(--card);
  border-color: #c9d7e6;
  box-shadow: inset 0 1px 2px rgba(22, 34, 47, .06);
}

/* Yapiskan ust cubuk icerigin ustunu ortmesin: capaya atlarken
   cubuk yuksekligi kadar bosluk birakiliyor. */
html { scroll-padding-top: 84px; }
.card, [id] { scroll-margin-top: 84px; }

@media (max-width: 560px) {
  html { scroll-padding-top: 72px; }
  .card, [id] { scroll-margin-top: 72px; }
}

/* --- Fotograf tam boy gorunum -------------------------------------------- */

.avatarbox__zoom {
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: zoom-in;
  line-height: 0;
}

.avatarbox__zoom:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

body.has-lightbox { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 14, 21, .82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.lightbox__inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.lightbox__img {
  display: block;
  max-width: min(90vw, 620px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}

.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 30, 42, .95);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}

.lightbox__close:hover { background: rgba(38, 52, 68, .98); }

@media (max-width: 430px) {
  .lightbox { padding: 18px; }
  .lightbox__close { top: -10px; right: -10px; width: 34px; height: 34px; }
}

/* --- Satir bazinda duzenleme --------------------------------------------- */

/* Her satirin kendi kalemi var; deger metni ile giris kutusu ayni yeri
   paylasiyor, satirlar yerinden oynamiyor. */

.iconedit--row {
  flex: none;
  margin-left: auto;
  opacity: .55;
  transition: opacity .15s ease;
}

.facts__row:hover .iconedit--row,
.facts__row.is-editing .iconedit--row { opacity: 1; }

.facts__row.is-editing .iconedit--row {
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

/* Priz adi: metin ve giris kutusu satirin icinde */

.device__name .rename__input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 240px;
  padding: 5px 9px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.device__name .rename__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.device__name.is-editing { flex: 1 1 auto; }

.device__rename {
  flex: none;
  opacity: .55;
  transition: opacity .15s ease;
}

.device__head:hover .device__rename,
.device__name.is-editing .device__rename { opacity: 1; }

.device__name.is-editing .device__rename {
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .iconedit--row, .device__rename { transition: none; }
}

/* Su tipi kutusu: .select genisligi %100 oldugu icin kalemi alt satira
   itiyordu. Satir icinde esneyen bir kutuya cevriliyor. */
.factform select.facts__in {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 210px;
  padding: 7px 34px 7px 10px;
  background-position: right 9px center;
  background-size: 16px 16px;
}

/* Secilemeyen mod dugmesi (ornegin sicaklik sensoru yokken Termo) */
.segmented__btn:disabled,
.segmented__btn[aria-disabled="true"] {
  opacity: .38;
  cursor: not-allowed;
}

.segmented__btn[aria-disabled="true"]:hover,
.segmented__btn[aria-disabled="true"]:focus,
.segmented__btn[aria-disabled="true"]:active,
.segmented__btn:disabled:hover {
  opacity: .38;
  background: none;
  color: inherit;
}

/* Twitch oynatici iframe yerine betikle kuruluyor; kutu olculeri
   iframe surumuyle ayni kalsin. */
#twitchPlayer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Rozet bekleme durumu: emir gonderildi, cihazin onaylamasi bekleniyor */
.pstate.is-pending {
  opacity: .62;
}

.pstate.is-pending .pstate__icon {
  animation: bc-spin 1.1s linear infinite;
}

.pstate.is-pending .pstate__dot {
  animation: bc-blink 1.1s ease-in-out infinite;
}

@keyframes bc-spin {
  to { transform: rotate(360deg); }
}

@keyframes bc-blink {
  50% { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
  .pstate.is-pending .pstate__icon,
  .pstate.is-pending .pstate__dot { animation: none; }
}

/* Rozette ikon ve yazinin iki hali de basiliyor; gorunen olani sinif
   seciyor. Yoklama yalnizca sinifi degistirerek rozeti guncelleyebiliyor. */
.pstate--auto   .pstate__icon--manual,
.pstate--auto   .pstate__text--manual,
.pstate--manual .pstate__icon--auto,
.pstate--manual .pstate__text--auto { display: none; }

/* Dort halin metni de basiliyor; gorunen olani sinif seciyor */
.pstate__text { display: none; }
.pstate--auto.pstate--on    .pstate__text--auto-on,
.pstate--auto.pstate--off   .pstate__text--auto-off,
.pstate--manual.pstate--on  .pstate__text--manual-on,
.pstate--manual.pstate--off .pstate__text--manual-off { display: inline; }

.pstate--auto   .pstate__icon--manual,
.pstate--manual .pstate__icon--auto { display: none; }

/* Cihaz uzerindeki anahtar elle bir konumdaysa mod secimi kilitli */
.segmented.is-locked { opacity: .55; }
.segmented.is-locked .segmented__btn { cursor: not-allowed; }

@media (max-width: 430px) {
  .pstate__text { display: none !important; }
}

/* Nabiz atan uyari simgesi: .stat__icon satir ici bir eleman oldugu icin
   transform uygulanmiyordu. Safari bunu katı yorumluyor, iOS'ta simge
   hic hareket etmiyordu. */
.stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Dar ekranda rozette uzun metin yerine tek kelimelik kaynak */
.pstate__src { display: none; }

@media (max-width: 430px) {
  .pstate__text { display: none !important; }
  .pstate--auto   .pstate__src--auto,
  .pstate--manual .pstate__src--manual { display: inline; }
  .pstate { padding: 5px 9px; gap: 5px; }
}

/* Ust cubuk sirasi: logo - (ayarlar, tema) - kullanici - cikis.
   Ortadaki ikili iki yanina da esit uzaklikta duruyor; cikis en sagda,
   parmagin yanlislikla degdigi yerden uzakta. */
.topbar__brand { order: 1; }

.topbar__actions {
  order: 2;
  margin-left: auto;
  margin-right: auto;
}

.topbar__user { order: 4; margin-left: 0; }

.topbar__logout {
  order: 5;
  margin: 0 0 0 12px;
}

/* Mobilde rozet kucultuluyor: tek kelimelik kaynak + nokta zaten yeterli,
   mevcut boyut satirda gereksiz yer kapliyordu (~%60). */
@media (max-width: 560px) {
  .pstate {
    gap: 4px;
    padding: 3px 7px 3px 5px;
  }

  .pstate__icon .ico {
    width: 11px;
    height: 11px;
  }

  .pstate__text,
  .pstate__src {
    font-size: .56rem;
    letter-spacing: .03em;
  }

  .pstate__dot {
    width: 6px;
    height: 6px;
  }
}

/* Mobilde yalniz balik isareti; "BluCory" yazisi gizleniyor */
@media (max-width: 560px) {
  .topbar__word { display: none; }
  .topbar__brand { gap: 0; }
}

/* Baglanti satiri: iki metin de basili, gorunen olani sinif seciyor.
   Son 15 saniyede bildirim geldiyse sayac yerine "cevrimici" yaziyor. */
.online__line .online__live { display: none; }
.online__line.is-live .online__live { display: inline; }
.online__line.is-live .online__ago { display: none; }

/* --- Kilitli alanlar (ayarlar sayfasi) ----------------------------------- */

/* Kaydet dugmesi olmayan formlarda deger duz metin gibi durur; kaleme
   dokununca kutu haline gelir. */

.lockwrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lockwrap input[readonly] {
  background: none;
  border-color: transparent;
  box-shadow: none;
  padding-left: 2px;
  cursor: pointer;
}

.lockwrap input {
  flex: 1 1 auto;
  min-width: 0;
}

.lockwrap__edit {
  flex: none;
  opacity: .55;
  transition: opacity .15s ease;
}

.field:hover .lockwrap__edit,
.lockwrap.is-editing .lockwrap__edit { opacity: 1; }

.lockwrap.is-editing .lockwrap__edit {
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

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

/* Wifi satirlari: etiket solda, deger sagda. Alt alta dizilince her ag
   gereksiz yer kapliyordu. */
.wifi .field {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.wifi .field__label {
  flex: 0 0 86px;
  margin: 0;
}

.wifi .lockwrap { flex: 1 1 auto; }

/* Kilitli alan tikanabilecegini belli etsin: zemin biraz farkli tonda */
.lockwrap input[readonly] {
  background: var(--track);
  border-color: var(--card-line);
  box-shadow: none;
  cursor: pointer;
}

.lockwrap input[readonly]:hover {
  border-color: var(--brand);
}

@media (max-width: 430px) {
  .wifi .field__label { flex-basis: 68px; }
}

/* --- Yem plani ----------------------------------------------------------- */

/* Uc sutun: gun, gunduz, gece. Tablo yerine izgara: hucre icinde
   fotograf, ad ve dugmeler serbestce dizilebilsin. */

.feedplan {
  display: grid;
  grid-template-columns: minmax(70px, 0.8fr) 1fr 1fr;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.feedplan__head,
.feedplan__row {
  display: contents;
}

.feedplan__hday,
.feedplan__hslot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--ink-2);
  background: var(--track);
  border-bottom: 1px solid var(--card-line);
}

.feedplan__hslot--day   { color: var(--warn); }
.feedplan__hslot--night { color: var(--brand); }

.feedplan__day {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-weight: 700;
  font-size: .86rem;
  text-align: center;
  border-bottom: 1px solid var(--card-line);
}

.feedcell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--card-line);
  border-left: 1px solid var(--card-line);
  min-width: 0;
}

.feedcell--day   { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.feedcell--night { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* Son satirin alt cizgisi kart kenarligiyla ikilenmesin */
.feedplan > .feedplan__row:last-child .feedcell,
.feedplan > .feedplan__row:last-child .feedplan__day { border-bottom: 0; }

.feedcell__photoform {
  position: relative;
  display: block;
  width: 74px;
  max-width: 100%;
}

.feedcell__pic {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-line);
}

.feedcell__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feedcell__noimg { color: var(--ink-3); }

/* Fotograf makinesi: gorselin sag alt kosesinde */
.feedcell__cam {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  cursor: pointer;
}

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

.feedcell__name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.feedcell__txt {
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  word-break: break-word;
}

.feedcell__in {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: center;
}

.feedcell__in:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

@media (max-width: 430px) {
  .feedplan { grid-template-columns: minmax(56px, 0.7fr) 1fr 1fr; }
  .feedcell { padding: 8px 5px; }
  .feedcell__pic,
  .feedcell__photoform { width: 60px; }
  .feedcell__pic { height: 60px; }
  .feedcell__txt { font-size: .76rem; }
  .feedplan__day { font-size: .78rem; padding: 8px 4px; }
}

/* Gun hucresi: tam ad ve altinda yem makinesi bolme numaralari */
.feedplan__day {
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.feedplan__dname { word-break: break-word; }

.feedplan__slots {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-3);
}

@media (max-width: 560px) {
  .feedplan { grid-template-columns: minmax(62px, 0.75fr) 1fr 1fr; }
  .feedplan__day { font-size: .74rem; }
  .feedplan__slots { font-size: .66rem; }
}

@media (max-width: 430px) {
  .feedplan { grid-template-columns: minmax(54px, 0.7fr) 1fr 1fr; }
  .feedplan__day { font-size: .68rem; padding: 8px 3px; }
  .feedplan__slots { font-size: .62rem; }
}

/* Fotograf yuklenirken gorselin uzerinde donen halka */
.feedcell__photoform.is-uploading .feedcell__pic {
  position: relative;
}

.feedcell__photoform.is-uploading .feedcell__pic::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 21, .55);
  border-radius: inherit;
}

.feedcell__photoform.is-uploading .feedcell__pic::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  animation: bc-spin .7s linear infinite;
}

/* Yukleme surerken makineye tekrar dokunulmasin */
.feedcell__photoform.is-uploading .feedcell__cam {
  pointer-events: none;
  opacity: .5;
}

@media (prefers-reduced-motion: reduce) {
  .feedcell__photoform.is-uploading .feedcell__pic::after { animation: none; }
}

/* --- Kullanici sozlesmesi ------------------------------------------------ */

/* Uzun metin: satir yuksekligi ve olcu okumayi kolaylastiracak sekilde. */
.terms {
  font-size: .88rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.terms h3 {
  margin: 22px 0 8px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
}

.terms h3:first-of-type { margin-top: 14px; }

.terms p { margin: 0 0 10px; }

.terms ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.terms li { margin-bottom: 5px; }

.terms strong { color: var(--ink); }

.terms__meta {
  font-size: .78rem;
  color: var(--ink-3);
  margin-bottom: 14px !important;
}

/* ==========================================================================
   Sagdan sola diller (Arapca)

   Dugme ve simge dizilimi hicbir dilde degismiyor: <html dir> her zaman
   ltr. Yalnizca duz metin bloklari sagdan sola akiyor ve saga
   hizalaniyor. Boylece Arapca metin dogru okunuyor ama arayuzun yerlesimi
   diger dillerdekiyle ayni kaliyor.
   ========================================================================== */

html[lang="ar"] .lede,
html[lang="ar"] .terms,
html[lang="ar"] .terms p,
html[lang="ar"] .terms li,
html[lang="ar"] .terms h3,
html[lang="ar"] .field__label,
html[lang="ar"] .field__hint,
html[lang="ar"] .setup__intro,
html[lang="ar"] .setup__note,
html[lang="ar"] .setup__steps li,
html[lang="ar"] .resetbox__list li,
html[lang="ar"] .resetbox__head,
html[lang="ar"] .logrow__note,
html[lang="ar"] .assist__body,
html[lang="ar"] .assist__note,
html[lang="ar"] .alert p {
  direction: rtl;
  text-align: right;
}

/* Girintili listelerde madde isareti de saga gecsin */
html[lang="ar"] .terms ul,
html[lang="ar"] .setup__steps,
html[lang="ar"] .resetbox__list {
  padding-left: 0;
  padding-right: 20px;
}

/* Ortalanmis metinler ortada kalsin */
html[lang="ar"] .online,
html[lang="ar"] .feedcell__txt,
html[lang="ar"] .feedplan__day { text-align: center; }

/* --- Kutuyu sifirla ------------------------------------------------------ */

.card--danger { border-color: color-mix(in srgb, var(--alert) 45%, var(--card-line)); }

.resetpick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.resetpick .btn.is-active {
  border-color: var(--alert);
  color: var(--alert);
  background: color-mix(in srgb, var(--alert) 10%, transparent);
}

.resetbox {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--alert) 40%, var(--card-line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--alert) 6%, transparent);
}

.resetbox__head {
  margin: 14px 0 6px;
  font-size: .86rem;
  font-weight: 800;
  color: var(--alert);
}

.resetbox__list {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.resetbox__list li { margin-bottom: 4px; }

.resetbox__form { margin-top: 14px; }

.btn--danger {
  color: #fff;
  background: var(--alert);
  border: 1px solid var(--alert);
}

.btn--danger:hover { filter: brightness(1.08); }

/* Cihaz devrinde geri donusu olmayan adim: kart bilgisi kaybolmussa
   cihaz bir daha kaydedilemiyor. Uyari metnin basinda ve belirgin. */
.resetwarn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  background: var(--alert);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .01em;
}

.resetwarn .ico { flex: none; margin-top: 1px; }

html[lang="ar"] .resetwarn span { direction: rtl; text-align: right; }

/* Hesap kutusundaki cihaz ve uyelik bilgileri: salt gosterim */
.facts--device {
  margin-bottom: 16px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--card-line);
}

.facts--device dd { text-align: right; }

.facts__expired { color: var(--alert); font-weight: 700; }

html[lang="ar"] .facts--device dd { direction: ltr; }

/* Uyelik bitis tarihi: kalan surenin altinda kucuk not */
.facts__sub {
  display: block;
  margin-top: 2px;
  font-size: .76rem;
  font-weight: 400;
  color: var(--ink-3);
}

/* --- Kayit sayfasi dil seridi -------------------------------------------- */

.langbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
}

.langbar__item {
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  opacity: .55;
  transition: opacity .15s ease, border-color .15s ease;
}

.langbar__item:hover { opacity: 1; }

.langbar__item.is-active {
  opacity: 1;
  border-color: var(--brand);
  background: var(--brand-soft);
}

.langbar__item svg { display: block; border-radius: 3px; }

/* Kayit sayfasindaki sozlesme kutusu: kart icinde dursun */
.terms-open {
  margin-bottom: 4px;
}

.terms-open .terms {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
}

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

/* --- Asistan yorumlari: her biri ayri acilir ----------------------------- */

/* Uc yorum birden acik durunca kutu cok uzuyordu. Artik <details>:
   kapali basliyor, kullanici istedigini aciyor. */

.assist > summary.assist__head {
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
  align-items: center;
}

.assist > summary.assist__head::-webkit-details-marker { display: none; }

.assist__kind { flex: 1 1 auto; }

.assist__chevron {
  display: flex;
  flex: none;
  color: var(--brand);
  transition: transform .18s ease;
}

.assist[open] .assist__chevron { transform: rotate(180deg); }

.assist[open] > summary.assist__head { margin-bottom: 8px; }

.assist > summary.assist__head:hover .assist__kind { text-decoration: underline; }

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

/* Bos gunluk listesindeki yonlendirme bagi */
.logs__empty a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
}

/* --- Yardim ve iletisim -------------------------------------------------- */

.help__head { margin-top: 22px; }

.msgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msgrow {
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
}

.msgrow__top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.msgrow__kind {
  font-size: .86rem;
  font-weight: 800;
  color: var(--ink);
}

.msgrow__when {
  font-size: .76rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.msgrow__state {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .03em;
}

.msgrow__state--new  { color: var(--brand); background: var(--brand-soft); }
.msgrow__state--read { color: var(--warn);  background: var(--warn-soft); }
.msgrow__state--done { color: var(--ok);    background: var(--ok-soft); }

.msgrow__body {
  margin: 0;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* Bizim yanitimiz: kullanicinin mesajindan ayrilsin */
.msgrow__reply {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Soru-cevap basliklari (sonradan doldurulacak) */
.faq {
  margin-top: 10px;
  border-bottom: 1px solid var(--card-line);
}

.faq__q {
  list-style: none;
  cursor: pointer;
  padding: 11px 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
}

.faq__q::-webkit-details-marker { display: none; }

.faq__a {
  padding: 0 0 12px;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--ink-2);
}

html[lang="ar"] .msgrow__body,
html[lang="ar"] .msgrow__reply,
html[lang="ar"] .faq__a { direction: rtl; text-align: right; }

html[lang="ar"] .msgrow__reply {
  border-left: 0;
  border-right: 3px solid var(--brand);
}

/* Yardim simgesi kullanici fotografinin solunda; ortadaki ayar grubuna
   degil kullanici tarafina ait. */
.topbar__help {
  order: 3;
  flex: none;
  margin-right: 4px;
}

/* Giris formunun altindaki "PIN'imi unuttum" bagi */
.formlink--forgot {
  margin: -4px 0 0;
  text-align: center;
  font-size: .86rem;
}

.formlink--forgot a {
  color: var(--ink-3);
  text-decoration: underline;
}

.formlink--forgot a:hover { color: var(--brand); }

/* --- Kart basligindaki eylem dugmesi ------------------------------------- */

.card__title { display: flex; align-items: center; gap: 10px; }

.card__act {
  display: grid;
  place-items: center;
  flex: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--ink-2);
  border: 1px solid var(--card-line);
  background: var(--track);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

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

.card__act.is-on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* Iki ikon da basili; gorunen olani duruma gore seciliyor */
.card__act-i--off { display: none; }
.card__act.is-on .card__act-i--on  { display: none; }
.card__act.is-on .card__act-i--off { display: grid; }

/* --- Olcum grafikleri ---------------------------------------------------- */

.charts { margin-top: 4px; }

.charts__range {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--card-line);
}

.charts__range .segmented__btn {
  flex: 1 1 0;
  padding: 7px 4px;
  font-size: .78rem;
  border-radius: 999px;
}

.chart { margin: 0 0 18px; }

.chart__cap {
  margin-bottom: 6px;
  font-size: .84rem;
  font-weight: 800;
  color: var(--ink-2);
}

/* Yukseklik sabit: Chart.js kendi kutusunu doldurur, sayfa titremez. */
.chart__box {
  position: relative;
  height: 180px;
}

.charts.is-loading { opacity: .5; }

@media (max-width: 560px) {
  .chart__box { height: 150px; }
  .charts__range .segmented__btn { font-size: .72rem; }
}

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



/* Kucuk dugme olcusu */
.btn--sm { padding: 8px 14px; font-size: .84rem; }

/* --- Eski olcum: yazi kuculur ve soluklasir ------------------------------ */

/* Cihaz sessiz kaldikca sensor degerleri kucultuluyor. Kutu renkleri
   degismiyor: esik durumu ayri bir bilgi ve o hala gecerli. Saat kutusu
   da etkilenmiyor, o tarayicidan geliyor. */

.stats .stat__text,
.stats .stat__icon .ico {
  transition: font-size .3s ease, opacity .3s ease,
              width .3s ease, height .3s ease;
}

.stats[class*="is-stale"] [data-stat] .stat__text { display: inline-block; }

.is-stale-1 [data-stat] .stat__text { font-size: .80em; opacity: .75; }
.is-stale-2 [data-stat] .stat__text { font-size: .60em; opacity: .58; }
.is-stale-3 [data-stat] .stat__text { font-size: .40em; opacity: .42; }
.is-stale-4 [data-stat] .stat__text { font-size: .10em; opacity: .30; }

/* Simge de degerle birlikte kuculsun, oransiz durmasin */
.is-stale-1 [data-stat] .stat__icon .ico { width: 16px; height: 16px; opacity: .75; }
.is-stale-2 [data-stat] .stat__icon .ico { width: 12px; height: 12px; opacity: .58; }
.is-stale-3 [data-stat] .stat__icon .ico { width: 8px;  height: 8px;  opacity: .42; }
.is-stale-4 [data-stat] .stat__icon .ico { width: 5px;  height: 5px;  opacity: .30; }

/* Etiket okunur kalsin: hangi kutu oldugu anlasilmali */
.is-stale-3 [data-stat] .stat__label,
.is-stale-4 [data-stat] .stat__label { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .stats .stat__text,
  .stats .stat__icon .ico { transition: none; }
}

/* --- Gunluk filtresi ----------------------------------------------------- */

/* Kucuk ve tek satirlik: liste bu kartin asil icerigi, filtre ona yer
   acan bir yardimci. Dugme yok, secim degisince kendiliginden uyguluyor. */

.logfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.logfilter__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 110px;
  min-width: 0;
}

.logfilter__field--kind { flex-basis: 140px; }

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

.logfilter select,
.logfilter input[type="date"] {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--track);
  border: 1px solid var(--card-line);
  border-radius: 8px;
}

/* Takvim simgesi koyu temada kaybolmasin */
[data-theme="dark"] .logfilter input[type="date"] { color-scheme: dark; }

.logfilter__clear {
  align-self: center;
  font-size: .78rem;
  color: var(--brand);
  text-decoration: underline;
  white-space: nowrap;
}

/* --- Kullanici el kitapciklari ------------------------------------------- */

.manuals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.manual {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease;
}

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

/* Kullanicinin kendi dili one ciksin */
.manual.is-mine {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.manual__flag { flex: none; display: flex; }
.manual__flag svg { border-radius: 3px; display: block; }

.manual__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .88rem;
  font-weight: 700;
}

.manual__size {
  flex: none;
  font-size: .72rem;
  color: var(--ink-3);
}

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

/* Yardim videolari: alt alta, her birinin ustunde basligi */
.helpvid { margin: 0 0 20px; }
.helpvid:last-of-type { margin-bottom: 0; }

.helpvid__cap {
  margin-bottom: 8px;
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink);
}

/* Hesap kutusunda cihaz basliklari */
.devhead {
  margin: 4px 0 6px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink-3);
}

.facts--device + .devhead { margin-top: 12px; }

/* Otomasyon cihazi olmayan kullanicida yem makinesinin baglanti satiri
   kutularin ustunde, acikta duruyor */
.online--solo { margin: 0 0 12px; text-align: center; }

/* Bildirimler kutusu: secenekler alt alta, aralarinda nefes payi */
.notifyform { display: flex; flex-direction: column; gap: 10px; }
.notifyform .check { align-items: flex-start; line-height: 1.45; }

/* --- Yem makinesi kontrol ------------------------------------------------ */

.feednow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.btn--feed { padding: 14px 22px; font-size: 1rem; }

/* Istek beklerken dugme kapali: iki kez yem gonderilmesin */
.btn--feed:disabled { opacity: .55; cursor: default; }

.feedtimes { display: flex; flex-direction: column; gap: 4px; }

/* Yedi gun x iki ogun uzun bir liste: satirlar dar tutuluyor ki kutu
   sayfayi asagi dogru gereksiz uzatmasin. */
.feedday {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--track);
  border: 1px solid var(--card-line);
}

.feedday__name {
  flex: 0 0 84px;
  font-size: .82rem;
  font-weight: 800;
}

.feedrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
}

.feedrow + .feedrow { border-left: 1px dashed var(--card-line); padding-left: 10px; }

/* Etiket daralmasin, kirpilmasin: sabit genislik ve tek satir. Esnek
   birakilinca yazi saat kutusunun altinda kaliyordu. */
.feedrow__slot {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: .8rem;
  color: var(--ink-2);
}

.feedrow__slot svg { flex: none; }

/* Saat kutusu artik daha genis olabilir: etiket yalniz simge. */
.feedrow { gap: 6px; }

.feedrow__slot--day   { color: var(--warn); }
.feedrow__slot--night { color: var(--brand); }

.feedrow input[type="time"] {
  flex: 0 1 auto;
  width: 96px;
  min-width: 76px;
  padding: 4px 7px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 8px;
}

[data-theme="dark"] .feedrow input[type="time"] { color-scheme: dark; }

/* Ac/kapa anahtari. Sinif adi .fsw: .switch sistemde baska bir bilesen
   tarafindan kullaniliyor, kurallar birbirine karisiyordu. */
.fsw { flex: none; cursor: pointer; display: inline-flex; }
.fsw input { position: absolute; opacity: 0; width: 0; height: 0; }

.fsw__track {
  display: block;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--card-line);
  transition: background .15s ease;
}

.fsw__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}

.fsw input:checked + .fsw__track { background: var(--ok); }
.fsw input:checked + .fsw__track .fsw__knob { transform: translateX(18px); }

/* Saat girilmemis ogun: anahtar kapali ve soluk */
.fsw.is-off { cursor: not-allowed; opacity: .45; }

.feedlog {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
}

.feedlog li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 12px;
  font-size: .84rem;
}

.feedlog li + li { border-top: 1px solid var(--card-line); }

.feedlog__when {
  flex: none;
  color: var(--brand);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.feedlog__what { color: var(--ink-2); }

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

@media (max-width: 560px) {
  .feedday { flex-wrap: wrap; padding: 6px 10px; }
  .feedday__name { flex: 1 1 100%; }
  .feedrow + .feedrow { border-left: 0; padding-left: 0; }
  .feedrow { flex: 1 1 100%; }
}

/* --- Kutu icindeki acilir bolumler --------------------------------------- */

/* Yem makinesi kutusunda otomatik saatler ve kayitlar ayri ayri
   aciliyor: kutu acildiginda uzun bir liste degil, iki baslik
   karsiliyor. */
.subcard {
  margin-top: 12px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--track);
}

.subcard__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  list-style: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink);
}

.subcard__head::-webkit-details-marker { display: none; }

.subcard__head > span:first-child { flex: 1 1 auto; }

.subcard__head svg {
  flex: none;
  color: var(--brand);
  transition: transform .18s ease;
}

.subcard[open] > .subcard__head svg { transform: rotate(180deg); }

.subcard[open] > .subcard__head { border-bottom: 1px solid var(--card-line); }

.subcard__count {
  flex: none;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .72rem;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--card-line);
}

.subcard__body { padding: 12px 13px; }

.subcard__body .lede { margin-top: 0; }

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