/* nehirSchedule — Tema ve düzen (mobile-first, iPad/iPhone Safari öncelikli) */

:root {
  /* ROADMAP §2 — Renk paleti */
  --primary: #400b36;
  --primary-active: #5c154f;
  --primary-light: #f3ebf2;
  --secondary: #8b3a78;
  --accent: #f5a623;
  --danger: #d93838;
  --background: #faf7f9;
  --surface: #ffffff;
  --text-main: #1c0d18;
  --text-muted: #6b5866;
  /* PIN ekranı degradesinin bittiği ton — güvenli alan da bu renkle boyanır. */
  --login-bottom: #2a0722;

  --line: #e7dce5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(64, 11, 54, 0.08);
  --shadow-lift: 0 10px 26px rgba(64, 11, 54, 0.26);

  /* Izgara ölçüleri — JS, --slot-count değerini günceller */
  --slot-h: 30px;
  --slot-count: 30;
  --rail-w: 52px;
  --col-min: 108px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
}

/*
 * Kök arka plan canvas'a yansır; iOS'ta ana ekrana eklendiğinde güvenli alanın
 * (home indicator şeridi) rengini bu belirler. PIN ekranındayken koyu tona geçer,
 * böylece altta açık renk bir şerit kalmaz.
 */
html { background: var(--background); }
html.is-login { background: var(--login-bottom); }

body {
  background: transparent;
  color: var(--text-main);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ================================ PIN Ekranı ================================ */

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background: linear-gradient(165deg, var(--primary) 0%, var(--login-bottom) 100%);
  z-index: 50;
  overflow-y: auto;
}

.login__card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  color: #fff;
}

.login__logo {
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
  border-radius: 20px;
}

.login__title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
  text-wrap: balance;
}

.login__subtitle {
  margin: 8px 0 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.login__note {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.pin-dot {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transition: background-color 0.15s, transform 0.15s;
}

.pin-dot.is-filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.12);
}

.login__error {
  min-height: 22px;
  margin: 0 0 16px;
  color: #ffc9c9;
  font-size: 14px;
}

.login.is-shaking .login__card { animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
  gap: 13px;
}

.numpad__key {
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  font-weight: 500;
  transition: background-color 0.12s, transform 0.12s;
}

.numpad__key:active {
  background: rgba(255, 255, 255, 0.34);
  transform: scale(0.94);
}

.numpad__key--action { font-size: 22px; background: transparent; }

/* ============================== Uygulama Kabuğu ============================== */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  padding: calc(8px + var(--safe-top)) max(14px, var(--safe-right)) 8px 14px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}

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

/*
 * Dokunma hedefleri: görsel daireler kompakt kalır, ::after ile dokunma alanı
 * Apple HIG'in 44×44 pt alt sınırına genişletilir. Aradaki boşluklar da
 * hedefler üst üste binmeyecek şekilde ayarlandı.
 */
.icon-btn,
.weeknav__arrow,
.weeknav__today,
.dialog__close {
  position: relative;
}

.icon-btn::after,
.weeknav__arrow::after,
.weeknav__today::after,
.dialog__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
}

.topbar__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.1px;
  color: rgba(255, 255, 255, 0.92);
}

/* Emoji kümesi satır sonunda ortadan bölünmesin */
.title__emoji { white-space: nowrap; letter-spacing: 1px; }

.topbar__actions { display: flex; gap: 10px; flex: 0 0 auto; }

.icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.icon-btn:active { background: rgba(255, 255, 255, 0.3); }
.icon-btn--dark { background: rgba(64, 11, 54, 0.1); color: var(--primary); }
.icon-btn--dark:active { background: rgba(64, 11, 54, 0.2); }

/* Hafta gezinme */
.weeknav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.weeknav__arrow {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.weeknav__arrow:active { background: rgba(255, 255, 255, 0.3); }
.weeknav__arrow:disabled { opacity: 0.28; cursor: default; }

.weeknav__label {
  flex: 1;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.weeknav__today {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #35240a;
  font-size: 11.5px;
  font-weight: 700;
}

/* Mod (solda, kompakt) + kapsam (sağda) tek satırda */
.switchbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mode-switch,
.scope-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.26);
  border-radius: 999px;
}

/* Mod anahtarı içeriği kadar yer kaplar, kapsam sağa itilir. */
.mode-switch { flex: 0 0 auto; margin-right: auto; }
.scope-switch { flex: 0 1 auto; min-width: 0; }

.mode-switch__btn,
.scope-switch__btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 11px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s;
}

.mode-switch__btn.is-active { background: var(--surface); color: var(--primary); }
.scope-switch__btn.is-active { background: var(--accent); color: #35240a; }

/* ================================= Takvim ================================= */

.calendar-root {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar {
  display: grid;
  grid-template-columns: var(--rail-w) repeat(7, minmax(var(--col-min), 1fr));
  grid-template-rows: auto 1fr;
  min-width: max-content;
}

/* Gün görünümü: tek sütun, ekranın tamamını kaplar */
.calendar--day {
  grid-template-columns: var(--rail-w) 1fr;
  min-width: 100%;
}

.calendar--day .day-head__name { font-size: 13px; color: var(--primary); }
.calendar--day .block { font-size: 13px; }
.calendar--day .block__time { font-size: 12px; }

.calendar__corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 6;
  background: var(--background);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.day-head {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 7px 4px 8px;
  background: var(--background);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
}

.day-head__name {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.day-head__date {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 700;
}

.day-head.is-today .day-head__date {
  display: inline-block;
  min-width: 27px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.day-head.is-past { opacity: 0.55; }

.day-head__badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #3d2a06;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.day-head__badge:active { background: #d98f17; }

.time-rail {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--background);
  border-right: 1px solid var(--line);
  touch-action: pan-x pan-y;
}

.time-rail__mark {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.time-rail__mark--first { transform: translateY(0); }

.day-col {
  position: relative;
  height: calc(var(--slot-count) * var(--slot-h));
  border-left: 1px solid var(--line);
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0 1px,
    transparent 1px calc(var(--slot-h) * 2)
  );
  touch-action: pan-x pan-y;
}

.day-col.is-override { background-color: #fffaf0; }
.day-col.is-past { opacity: 0.6; }

/* Bugünün sütununda şu anki saati gösteren çizgi */
.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9;
  background: var(--danger);
  pointer-events: none;
}

.now-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--danger);
}

/* Slot blokları — konum JS tarafından inline `top`/`height` ile verilir */
.block {
  position: absolute;
  left: 3px;
  right: 3px;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.22;
  color: #fff;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.block__name { font-weight: 700; display: block; }
.block__time { display: block; opacity: 0.82; font-size: 10.5px; font-variant-numeric: tabular-nums; }

.block--availability {
  background: var(--primary-light);
  border: 1px solid var(--secondary);
  color: var(--primary);
}

/*
 * Dolgu bloğu boşluğun tamamını kaplar, bu yüzden saatlerce sürebilir.
 * İlk katman yarım saat tikleri (JS, gerçek ızgarayla hizalar), ikincisi desen.
 */
.block--filler {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(139, 58, 120, 0.26) 0 1px,
      transparent 1px var(--slot-h)
    ),
    repeating-linear-gradient(135deg, var(--primary-light) 0 8px, #e9dbe7 8px 16px);
  border: 1px dashed var(--secondary);
  color: var(--primary);
}

.block--task { box-shadow: var(--shadow); }

/* Açık tonlu bloklar beyaz takvim zemininde kaybolmasın diye ince kenarlık alır */
.block--task.is-light { box-shadow: inset 0 0 0 1px rgba(28, 13, 24, 0.2), var(--shadow); }

.block.is-override { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Nehir'in "yaptım" işareti: blok soluklaşır, köşesine tik gelir */
.block.is-done { opacity: 0.55; }

.block.is-done .block__name { text-decoration: line-through; }

.block__tick {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2f6f4f;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.block__tick::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  width: 5px;
  height: 9px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: solid #fff;
  border-width: 0 2px 2px 0;
}

/* Program modunda bloklar dokunulabilir olduklarını belli etsin */
.day-col .block[data-kind] { cursor: pointer; }

/* Silme açıkken blok öne alınır ve üzeri karartılır */
.block.is-open {
  z-index: 8;
  overflow: visible;
  box-shadow: var(--shadow-lift);
}

.block.is-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(28, 13, 24, 0.42);
}

.block__delete {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-lift);
}

.block__delete:active { background: #b62d2d; }

/* Tıklama hedefi her zaman düğmenin kendisi olsun */
.block__delete-icon { flex: 0 0 auto; pointer-events: none; }

/* Kısa bloklarda düğme kutunun dışına taşabilsin */
.block--short .block__delete { min-height: 30px; font-size: 12px; padding: 0 12px; }
.block--short .block__delete-icon { width: 13px; height: 13px; }

/* Sürükleme sırasındaki hedef önizlemesi */
.drop-preview {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--primary);
  background: rgba(64, 11, 54, 0.12);
  pointer-events: none;
}

.drop-preview--invalid {
  border-color: var(--danger);
  background: rgba(217, 56, 56, 0.14);
}

.drop-preview--erase {
  border-color: var(--danger);
  border-style: solid;
  background: repeating-linear-gradient(
    135deg,
    rgba(217, 56, 56, 0.2) 0 7px,
    rgba(217, 56, 56, 0.08) 7px 14px
  );
}

.drag-ghost {
  position: fixed;
  z-index: 60;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.94;
}

/* ============================== Bağlantı Yok ============================== */

.offline {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 28px;
  text-align: center;
}

.offline__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--primary); }

.offline__text {
  margin: 0 0 8px;
  max-width: 320px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* =============================== Ders Havuzu =============================== */

.task-pool {
  padding: 8px 12px calc(10px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(64, 11, 54, 0.07);
}

.task-pool__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.task-pool__hint { font-weight: 400; color: var(--text-muted); font-size: 11px; }

.task-pool__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  -webkit-overflow-scrolling: touch;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s, box-shadow 0.12s;
}

.chip__minutes { opacity: 0.78; font-weight: 400; }
.chip.is-light { box-shadow: inset 0 0 0 1px rgba(28, 13, 24, 0.2); }

.chip.is-selected {
  box-shadow: 0 0 0 3px var(--accent);
  transform: translateY(-2px);
}

/* ========================== Haftalık Dağılım Çekmecesi ========================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 64;
  background: rgba(28, 13, 24, 0.45);
  animation: fade-in 0.2s;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  width: min(86vw, 380px);
  padding-right: var(--safe-right);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  animation: slide-in 0.24s ease-out;
}

@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 18px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer__title { margin: 0; font-size: 17px; color: var(--primary); }
.drawer__subtitle { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px calc(20px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.stat__swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(28, 13, 24, 0.14);
}

.stat__name { flex: 1; font-size: 13.5px; }
.stat__value { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__share { min-width: 42px; text-align: right; font-size: 11.5px; color: var(--text-muted); }

.stat__bar {
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.stat__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(28, 13, 24, 0.14);
}

.stat--total {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--primary);
  border-bottom: none;
  font-weight: 700;
  color: var(--primary);
}

.stat--total .stat__name,
.stat--total .stat__value { font-size: 15px; }

.stat--done {
  border-bottom: none;
  font-weight: 700;
  color: #2f6f4f;
}

.stat--done .stat__name,
.stat--done .stat__value { font-size: 15px; }

.drawer__group {
  margin: 18px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--secondary);
}

.drawer__empty {
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.daybar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
}

.daybar__name { width: 34px; flex: 0 0 auto; color: var(--text-muted); }
.daybar__track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.daybar__fill { display: block; height: 100%; border-radius: 999px; background: #d9c2d4; }

.daybar__done {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: 999px;
  background: #2f6f4f;
}
.daybar__value {
  width: 72px;
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ============================ Toast ve Diyaloglar ============================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 70;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--text-main);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  box-shadow: var(--shadow-lift);
}

.toast.is-error { background: var(--danger); }
.toast.is-success { background: #2f6f4f; }

.dialog {
  width: min(92vw, 380px);
  max-height: 88vh;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-lift);
}

.dialog--wide { width: min(94vw, 460px); }
.dialog::backdrop { background: rgba(28, 13, 24, 0.45); }

/* Uzun modallarda kaydırmadan erişilebilen kapatma düğmesi */
.dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 15px;
  line-height: 1;
}

.dialog__close:active { background: #e4d3e1; }

.dialog__body {
  padding: 20px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dialog__title { margin: 0 0 14px; font-size: 18px; color: var(--primary); }

.dialog__section {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--secondary);
}

.dialog__section:first-of-type { margin-top: 4px; }
.dialog__section--danger { margin-top: 30px; color: var(--danger); }

/* Yanlışlıkla basılmasın diye modalın en altında, onaylı aksiyonlar */
.danger-zone {
  padding: 14px;
  border: 1px solid #f0cdcd;
  border-radius: var(--radius-sm);
  background: #fdf5f5;
}

.danger-zone .btn { margin-bottom: 6px; }
.danger-zone .btn--ghost-outline { border-color: var(--danger); color: var(--danger); }

.danger-zone__note {
  margin: 0 0 14px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.danger-zone__note:last-child { margin-bottom: 0; }
.dialog__note { margin: 14px 0 0; font-size: 12.5px; color: var(--text-muted); }
.dialog__error { min-height: 20px; margin: 10px 0 0; font-size: 12.5px; color: var(--danger); }
.dialog__spacer { flex: 1; }

.dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.guide { margin: 0; padding-left: 0; list-style: none; }

.guide li {
  display: block;
  margin-bottom: 14px;
  padding-left: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.guide strong { display: block; color: var(--primary); margin-bottom: 2px; }
.guide span { color: var(--text-muted); }
.guide em { font-style: normal; font-weight: 700; color: var(--secondary); }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

.field--stacked { display: block; }
.field--stacked > span { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--text-muted); }

.field select,
.field input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font: inherit;
}

.field-row .field select { width: auto; flex: 1; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.check input { width: 19px; height: 19px; margin: 0; flex: 0 0 auto; accent-color: var(--primary); }

/* Yalnızca bilgi veren, değiştirilemeyen işaret kutusu */
.check--readonly { opacity: 0.85; }
.check--readonly input { accent-color: var(--secondary); }

.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  justify-items: center;
}

.color-grid button {
  position: relative;
  width: 100%;
  max-width: 34px;
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  padding: 0;
}

/*
 * Palet koyu tonlardan oluştuğu için koyu bir kenarlık seçiliyi belli etmiyordu.
 * Beyaz iç halka + koyu dış halka her zemin üzerinde okunur, içindeki beyaz tik
 * de hangi rengin seçili olduğunu tek bakışta gösterir.
 */
.color-grid button.is-active {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--text-main);
}

.color-grid button.is-active::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  width: 7px;
  height: 12px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
}

.task-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}

.task-row:active { background: var(--primary-light); }

.task-row__swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(28, 13, 24, 0.14);
}
.task-row__name { flex: 1; font-size: 13.5px; font-weight: 600; }
.task-row__meta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.task-row__tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.btn:active { background: var(--primary-active); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--danger { background: var(--danger); }
.btn--block { display: block; width: 100%; }

.btn--ghost-outline {
  background: transparent;
  border: 1px dashed var(--secondary);
  color: var(--secondary);
}

/* ================================ Responsive ================================ */

/* iPad ve üzeri: 7 gün tek ekrana sığar, ızgara ferahlar */
@media (min-width: 768px) {
  :root { --slot-h: 34px; --rail-w: 60px; --col-min: 0px; }
  .calendar { min-width: 100%; }
  .block { font-size: 12.5px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .topbar__title { font-size: 15px; }
  .mode-switch__btn, .scope-switch__btn { font-size: 13px; padding: 8px 14px; }
  .weeknav__label { font-size: 14.5px; }
}

@media (min-width: 1100px) {
  :root { --slot-h: 38px; }
}

/* Dar iPhone ekranları — üç modlu anahtar + kapsam tek satıra sığsın */
@media (max-width: 400px) {
  :root { --col-min: 96px; --slot-h: 28px; }
  .numpad__key { width: 64px; height: 64px; }
  .topbar__title { font-size: 12px; }
  .topbar__actions { gap: 8px; }
  .mode-switch__btn, .scope-switch__btn { font-size: 10.5px; padding: 6px 8px; }
}
