/* Modernist — köşe yuvarlatma yok, 2px kurallar, tek kırmızı, flush-left etiketler. */

/* Archivo yerelden servis edilir — CDN çağrısı yok, çevrimdışı da çalışır.
   SIL Open Font License 1.1, bkz. frontend/fonts/OFL.txt */
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  /* Türkçe ğ, ş, İ bu aralıkta. */
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --ink: #201e1d;
  --accent: #ec3013;
  --accent-100: #fff2ef;
  --accent-700: #ae1800;
  --accent-400: #ff9783;
  --neutral-300: #d7d3d3;
  --neutral-400: #bab6b6;
  --divider: color-mix(in srgb, #201e1d 40%, transparent);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
[hidden] { display: none !important; }

/* ── iskelet ─────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100%; }
.app__body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.screen { display: block; }
.pad { padding: 0 20px; }
.pad--top { padding-top: 26px; }

.rule { height: 2px; border: 0; margin: var(--s4) 0; background: var(--divider); }
.rule--flush { margin: 18px 20px 0; }
.rule--tight { margin: 10px 0 4px; }

.h6 {
  margin: 0; font-size: 13px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
/* .h6'dan sonra tanımlı olmalı — aksi halde margin:0 bunu ezer. */
.mt-lg { margin-top: 30px; }
.mt-lg + .stack, .mt-lg + .rows, .mt-lg + .input { margin-top: 12px; }

.head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: calc(var(--safe-top) + 34px) 20px 0;
}
.head--simple { padding-bottom: 14px; }
.head__title { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.head__title--sm { font-size: 30px; }
.head__meta {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

/* ── kayıt posteri ───────────────────────────────────────────────── */
.poster {
  all: unset;
  /* flex zorunlu: button elemanı içeriğini yoksa dikeyde ortalar */
  display: flex; flex-direction: column; justify-content: space-between;
  width: 100%; height: 236px; overflow: hidden;
  background: var(--ink); color: var(--bg);
  padding: 20px; box-sizing: border-box;
  touch-action: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  transition: background .12s linear;
}
.poster.is-recording { background: var(--accent); }
.poster__kicker {
  display: block; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; opacity: .85;
}
.poster__row { display: flex; align-items: flex-end; gap: 14px; }
.poster__time {
  font-size: 44px; font-weight: 800; line-height: .9;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.levels { display: flex; align-items: flex-end; gap: 3px; height: 44px; flex: 1; justify-content: flex-end; }
.levels span { width: 5px; background: var(--bg); opacity: .9; height: 6px; transition: height .09s linear; }
.poster__foot {
  display: flex; justify-content: space-between; gap: 12px; padding-top: 8px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}

/* ── uyarı / bilgi ───────────────────────────────────────────────── */
.notice {
  margin: 20px; padding: 14px;
  background: var(--accent-100); border-left: 3px solid var(--accent);
}
.notice__title { font-weight: 800; font-size: 14px; }
.notice__body { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.5; opacity: .8; }

/* ── satır listesi (son fikirler) ────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.rows { display: block; }
.rows--tight .row-line { padding: 13px 0; }

.row {
  all: unset; display: flex; width: 100%; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--divider); cursor: pointer;
}
.row__time {
  width: 40px; flex: none; padding-top: 3px; font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.row__title { font-size: 15px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.row__meta { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.row__dot { width: 8px; height: 8px; flex: none; margin-top: 6px; }

.row-line {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--divider); font-size: 14px;
}
.row-line__meta {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

.empty { padding: 34px 0 10px; }
.empty__mark { width: 36px; height: 36px; background: var(--ink); margin-bottom: 14px; }
.empty__title { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.empty__body { font-size: 13px; opacity: .7; margin: 0; max-width: 250px; }
.list-empty { padding: 40px 0; font-size: 13px; opacity: .65; }

/* ── kartlar (fikir listesi) ─────────────────────────────────────── */
.cards { display: block; padding-bottom: 20px; }
.card {
  all: unset; display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 16px 0; border-bottom: 1px solid var(--divider);
}
.card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.card__date {
  margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.card__title { font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -.015em; margin-bottom: 7px; }
.card__summary { font-size: 13px; line-height: 1.5; opacity: .72; margin-bottom: 7px; }
.card__meta { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.tag {
  display: inline-flex; align-items: center; font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px;
}
.tag--accent { background: var(--accent-100); color: #7c1405; }
.tag--accent2 { background: #fff2ef; color: #71261b; }
.tag--neutral { background: #f8f4f4; color: #444141; }

/* ── kontroller ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px;
  font-weight: 800; font-size: 14px; line-height: 1.2;
  background: transparent; border: 1px solid transparent;
  padding: var(--s2) calc(var(--s3) * 1.2); border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:active { background: var(--accent-700); }
.btn--secondary { border-color: var(--divider); }
.btn--secondary:active { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.btn--ghost { color: var(--accent); padding-inline: var(--s1); }
.btn--danger { color: var(--accent-700); border-color: var(--divider); justify-content: center; }
.btn--block { width: 100%; margin-top: var(--s3); height: 46px; }
.btn--sm { font-size: 12.5px; height: 36px; }
.row-gap { display: flex; gap: 2px; }

.field { display: block; }
.field--inline { flex: 1; }
.field__label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.input {
  width: 100%; min-height: 40px; padding: 8px 10px; font-size: 16px; /* iOS zoom engeli */
  background: var(--surface); color: var(--ink); caret-color: var(--accent);
  border: 1px solid var(--divider); border-radius: 0; -webkit-appearance: none;
}
.input--bold { border-width: 2px; }
.input--area { min-height: 130px; border-width: 2px; font-size: 13px; line-height: 1.5; resize: vertical; }
.input:focus-visible { border-color: var(--accent); outline-offset: 0; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__dot { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--divider); }
.check input:checked + .check__dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--bg); }
.stack { display: flex; flex-direction: column; gap: 14px; }

.seg-row { display: flex; gap: 2px; margin-top: 2px; }
.seg {
  all: unset; flex: 1; text-align: center; padding: 11px 0; cursor: pointer;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 800;
  border: 1px solid var(--divider);
}
.seg.is-on { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 14px 20px 4px;
  margin: 0 -20px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  all: unset; flex: none; padding: 7px 12px; cursor: pointer; white-space: nowrap;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--divider);
}
.chip.is-on { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.date { margin-top: 10px; }
.date__summary { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; color: var(--accent); }
.date__body { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }

/* ── alt sekme ───────────────────────────────────────────────────── */
.tabs {
  display: flex; flex: none;
  border-top: 2px solid var(--divider); background: var(--bg);
  padding-bottom: calc(var(--safe-bottom) + 8px);
}
.tab {
  all: unset; flex: 1; text-align: center; padding: 12px 0 8px; cursor: pointer;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  border-top: 3px solid transparent; margin-top: -2px;
}
.tab.is-on { color: var(--ink); border-top-color: var(--accent); }
.tab__badge {
  display: inline-block; margin-left: 5px; padding: 1px 5px;
  background: var(--accent); color: var(--bg); font-size: 9.5px;
}

/* ── geri al çubuğu ──────────────────────────────────────────────── */
.undo {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 78px);
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; z-index: 40;
  background: var(--ink); color: var(--bg);
  box-shadow: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
  animation: riseIn .2s ease-out;
}
.undo__text { flex: 1; font-size: 12.5px; }
.undo__action { all: unset; cursor: pointer; color: var(--accent-400); font-size: 12.5px; font-weight: 800; }

/* ── detay ───────────────────────────────────────────────────────── */
.detail {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: var(--bg); animation: riseIn .2s ease-out;
}
.detail__head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 26px) 20px 12px;
  border-bottom: 2px solid var(--divider);
}
.detail__meta { margin-left: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.detail__body { flex: 1; overflow-y: auto; padding: 20px 20px calc(var(--safe-bottom) + 40px); }
.detail__title { font-size: 26px; font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: 12px 0 10px; }
.detail__summary { font-size: 14px; line-height: 1.6; opacity: .85; margin: 0; }
.detail__raw {
  margin: 12px 0 0; padding: 14px; background: var(--surface);
  font-size: 12.5px; line-height: 1.65; opacity: .8; white-space: pre-wrap;
}

.actions { display: flex; flex-direction: column; }
.action {
  display: flex; gap: 10px; padding: 10px 0; font-size: 13.5px; line-height: 1.4;
  border-bottom: 1px solid var(--divider);
}
.action__mark { color: var(--accent); font-weight: 800; }

.player { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); }
.player__btn {
  all: unset; width: 38px; height: 38px; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--bg); font-size: 13px;
}
.player__track { flex: 1; height: 3px; background: var(--neutral-300); position: relative; }
.player__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.player__time { font-size: 11px; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--ink) 55%, transparent); }

.detail__actions { display: flex; gap: 2px; margin-top: 16px; }
.detail__actions .btn { flex: 1; height: 44px; }
.detail__actions .btn--danger { flex: 0 0 64px; }

.edit-stack { display: flex; flex-direction: column; gap: 12px; margin: 14px 0 4px; }

/* ── sheet ───────────────────────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end;
  background: color-mix(in srgb, #2d2b2b 55%, transparent);
}
.sheet__panel {
  width: 100%; background: var(--bg); border-top: 3px solid var(--ink);
  padding: 24px 20px calc(var(--safe-bottom) + 28px);
  animation: sheetUp .24s cubic-bezier(.2,.8,.2,1);
}
.sheet__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.sheet__lead { font-size: 13px; opacity: .7; margin: 0 0 18px; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--divider); align-items: flex-start; }
.step__n { font-size: 11px; font-weight: 800; width: 18px; flex: none; color: var(--accent); }
.step__title { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.step__body { font-size: 12.5px; opacity: .7; line-height: 1.45; }

.pwa-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--ink); margin-bottom: 24px; }
.pwa-card__tag {
  flex: none; padding: 3px 7px; background: var(--ink); color: var(--bg);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.pwa-card__title { font-size: 13.5px; font-weight: 800; margin-bottom: 4px; }
.pwa-card__text { font-size: 12.5px; line-height: 1.5; opacity: .75; margin: 0 0 10px; }

/* ── giriş ekranı ────────────────────────────────────────────────── */
.screen--login { display: flex; align-items: center; justify-content: center; height: 100%; padding: 20px; }
.login { width: 100%; max-width: 340px; }
.login__title { margin: 0; font-size: 40px; font-weight: 800; line-height: 1.02; letter-spacing: -.03em; }
.login__form { display: flex; flex-direction: column; gap: 12px; }
.login__error { margin: 0; font-size: 12.5px; color: var(--accent-700); }

/* ── ayarlar altı ────────────────────────────────────────────────── */
.settings__status { margin: 10px 0 0; font-size: 12px; color: var(--accent-700); }
.settings__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--divider);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.settings__version {
  padding: 20px 0 calc(var(--safe-bottom) + 20px);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
}

/* ── toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 78px);
  z-index: 80; padding: 13px 14px; font-size: 12.5px;
  background: var(--ink); color: var(--bg); animation: riseIn .18s ease-out;
}

@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Masaüstü ikincil — içeriği telefon genişliğinde ortala. */
@media (min-width: 720px) {
  .app { max-width: 480px; margin: 0 auto; border-inline: 2px solid var(--divider); }
}
