/* Kelime — APK'daki Theme.kt renkleri ve Components.kt ölçüleri (dp = px). */

@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #F2F3EF; --surface: #FFFFFF; --ink: #15171A; --muted: #5D636B; --nav-muted: #646A72;
  --dim: #9AA0A6; --line: #E3E5E0; --divider: #ECEDE8; --track: #E8EAE4; --segment: #E4E6E0;
  --fresh: #DADDD6; --ring: #C9CCC5; --green: #1E6B52; --green-light: #8CC7A8; --green-mid: #3F9472;
  --green-pale: #C9E3D5; --green-bg: #E3F1EA; --green-ink: #11452F; --orange: #C2560F; --flame: #E0702A;
  --orange-bg: #FBEDE4; --flame-bg: #FDEEE3; --orange-ink: #7A2E06; --wrong: #B4410E;
  --on-ink: #FFFFFF; --on-ink-muted: #BCC0C6; --on-ink-soft: #E4E6E9; --on-accent: #FFFFFF;
  --warn-ink: #9A3D0B; --warn-soft: #FBE4D6; --weak-sub: #6B3A1C; --quiz-track: #DFE1DB;
  --heat-empty: #E8EAE4; --goal-line: #B9BDB4; --task-ring: #D3D6CF;
  --scrim: rgba(21, 23, 26, 0.45);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --ground: #111315; --surface: #1C1F22; --ink: #ECEEF0; --muted: #A3A9B0; --nav-muted: #9AA0A7;
  --dim: #6C727A; --line: #2E3237; --divider: #272B2F; --track: #2A2E33; --segment: #26292D;
  --fresh: #3A3F45; --ring: #4A5057; --green: #5CC197; --green-light: #2E6B54; --green-mid: #3F9A76;
  --green-pale: #1E4334; --green-bg: #16332A; --green-ink: #A8E3C7; --orange: #E57A35; --flame: #F08A45;
  --orange-bg: #3A2418; --flame-bg: #3A2418; --orange-ink: #F6C3A1; --wrong: #F08A5A;
  --on-ink: #111315; --on-ink-muted: #4A5057; --on-ink-soft: #2A2E33; --on-accent: #0F1A15;
  --warn-ink: #F6A57A; --warn-soft: #4A2A1A; --weak-sub: #E8B48F; --quiz-track: #2C3035;
  --heat-empty: #25292D; --goal-line: #50565C; --task-ring: #3A3F45;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--ink); }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px; line-height: 1.3;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

#app {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
}
.screen {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: calc(20px + env(safe-area-inset-top)) 20px 20px; }
.pad-bottom { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.grow { flex: 1; min-width: 0; }
.center { align-items: center; justify-content: center; }
.gap2 { gap: 2px } .gap3 { gap: 3px } .gap4 { gap: 4px } .gap6 { gap: 6px } .gap8 { gap: 8px }
.gap10 { gap: 10px } .gap12 { gap: 12px } .gap14 { gap: 14px } .gap16 { gap: 16px } .gap18 { gap: 18px } .gap20 { gap: 20px }

.display { font-family: 'Bricolage', 'Inter', sans-serif; font-variation-settings: 'opsz' 36; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t11 { font-size: 11px } .t12 { font-size: 12px } .t13 { font-size: 13px } .t14 { font-size: 14px }
.t15 { font-size: 15px } .t16 { font-size: 16px } .t17 { font-size: 17px } .t18 { font-size: 18px }
.w500 { font-weight: 500 } .w600 { font-weight: 600 } .w700 { font-weight: 700 } .w800 { font-weight: 800 }

.panel { background: var(--surface); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; }
button.panel { width: 100%; }
.divider { height: 1px; background: var(--divider); flex-shrink: 0; }

.btn-primary, .btn-secondary {
  width: 100%; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; text-align: center;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:disabled { background: var(--dim); }
.btn-secondary { background: var(--surface); border: 1.5px solid var(--line); font-size: 16px; }
.btn-primary:active, .btn-secondary:active, .press:active { opacity: 0.85; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn.bg { background: var(--surface); }
.link-btn { border-radius: 10px; padding: 10px; font-size: 14px; font-weight: 600; }
.link-btn.green { color: var(--green); }
.link-btn.red { color: var(--wrong); }

svg.ic { display: block; flex-shrink: 0; }

.bar { width: 100%; border-radius: 99px; background: var(--track); overflow: hidden; flex-shrink: 0; }
.bar > div { height: 100%; border-radius: 99px; background: var(--green); }
.stack-bar { width: 100%; display: flex; border-radius: 99px; overflow: hidden; background: var(--fresh); flex-shrink: 0; }
.stack-bar > .m { background: var(--green); } .stack-bar > .l { background: var(--green-light); }

.dots { display: flex; gap: 3px; }
.dots > span { border-radius: 50%; background: var(--fresh); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
}

.section-label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }

/* Haftalık şerit */
.week { display: flex; justify-content: space-between; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week .circle { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Alt menü */
.nav {
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: center;
  height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
}
.nav button {
  width: 96px; border-radius: 14px; padding: 8px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; color: var(--nav-muted); font-weight: 500;
}
.nav button.on { color: var(--ink); font-weight: 700; }

/* Quiz */
.option {
  width: 100%; min-height: 62px; border-radius: 16px; padding: 0 18px;
  background: var(--surface); border: 1.5px solid var(--line);
  display: flex; align-items: center; gap: 14px; color: var(--ink);
}
.option .key {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--ground); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.option .txt { flex: 1; padding: 10px 0; font-weight: 500; overflow-wrap: anywhere; }
.option.right { background: var(--green-bg); border: 2px solid var(--green); color: var(--green-ink); }
.option.right .key { background: var(--green); color: var(--on-accent); }
.option.wrong { background: var(--orange-bg); border: 2px solid var(--orange); color: var(--orange-ink); }
.option.wrong .key { background: var(--orange); color: var(--on-accent); }
.option.dim { opacity: 0.5; }
.prompt { font-weight: 700; letter-spacing: -0.03em; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.sheet-panel {
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; flex-shrink: 0;
}

/* Liste ekranı */
.mode-opt {
  width: 100%; border-radius: 18px; background: var(--surface); border: 2px solid transparent;
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
}
.mode-opt.on { border-color: var(--ink); }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ring); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mode-opt.on .radio { border-color: var(--ink); }
.mode-opt.on .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.segments { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--segment); }
.segments button { flex: 1; height: 40px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 500; color: var(--muted); }
.segments button.on { background: var(--surface); color: var(--ink); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 40px; border-radius: 999px; padding: 0 14px; flex-shrink: 0;
  background: var(--surface); border: 1.5px solid var(--line);
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.chip small { font-size: 12px; opacity: 0.75; }

/* Diyalog */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade 0.15s ease;
}
.dialog {
  background: var(--surface); border-radius: 24px; width: 100%; max-width: 420px;
  max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.dialog .d-title { padding: 22px 22px 8px; font-size: 22px; font-weight: 700; }
.dialog .d-body { padding: 8px 22px; overflow-y: auto; color: var(--muted); font-size: 15px; line-height: 1.45; }
.dialog .d-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 12px 14px 14px; }
.dialog .d-actions button { padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--green); }
.dialog .d-actions button.red { color: var(--wrong); }
.dialog .d-actions button:disabled { color: var(--dim); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); padding: 10px 12px; font-size: 16px; /* 16px: iOS yakınlaştırmasın */
}
textarea.input { resize: vertical; line-height: 1.4; }
.input:focus { outline: none; border-color: var(--green); }

.goal-chips { display: flex; gap: 6px; }
.goal-chips button {
  flex: 1; height: 40px; border-radius: 12px; border: 1.5px solid var(--line);
  text-align: center; font-size: 14px; font-weight: 600; color: var(--ink);
}
.goal-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.switch-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px 0; border-radius: 12px; }
.switch { width: 52px; height: 32px; border-radius: 99px; background: var(--track); border: 2px solid var(--ring); position: relative; flex-shrink: 0; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ring); transition: transform 0.15s, background 0.15s; }
.switch.on { background: var(--green); border-color: var(--green); }
.switch.on::after { transform: translateX(20px); background: var(--on-accent); width: 24px; height: 24px; top: 2px; left: 2px; }

.time-row { display: flex; align-items: center; gap: 8px; }
.time-row input { flex: 1; }

.menu {
  position: fixed; z-index: 60; background: var(--surface); border-radius: 16px; padding: 6px 0; min-width: 160px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.menu button { width: 100%; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 14px; z-index: 70;
  font-size: 14px; font-weight: 500; max-width: calc(100% - 40px); text-align: center;
  animation: fade 0.15s ease;
}

.install-steps { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.install-steps .step { display: flex; gap: 12px; align-items: flex-start; }
.install-steps .num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--green-bg); color: var(--green-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.share-glyph { display: inline-block; vertical-align: -4px; }
