/* Bahane Bulucu — OLED gece mavisi, tek ekran, kaydırmasız */
:root {
  --bg: #000;
  --bg2: #03050b;
  --surface: #070b16;
  --surface2: #0b1120;
  --line: #141c30;
  --line2: #1d2740;
  --text: #e4e7ee;
  --muted: #8790a6;
  --dim: #565f78;
  --accent: #7b93ff;
  --accent-ink: #050815;
  --ok: #5fd3a2;
  --heat: #7b93ff;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; font-size: 16px; line-height: 1.45; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.app {
  height: 100dvh; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--safe-b)); overflow-x: hidden;
  background: radial-gradient(120% 60% at 50% 0%, #070c1d 0%, var(--bg) 60%);
}
.top { display: flex; align-items: center; justify-content: space-between; height: 58px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2px; user-select: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line2); font-size: 15px; }
.brand-name { font-size: 15px; color: var(--muted); }
.top-actions { display: flex; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); position: relative; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.spark .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3vh, 26px); padding: 6px 0 10px; }

.card { background: linear-gradient(180deg, var(--surface) 0%, var(--bg2) 100%); border: 1px solid var(--line); border-radius: 22px; padding: 16px 16px 12px; display: flex; flex-direction: column; min-height: 0; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--dim); text-transform: none; min-height: 18px; }
.card-meta #metaWho { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cred b { color: var(--ok); font-weight: 600; }
.excuse { text-align: left; display: block; width: 100%; padding: 14px 0 10px; font-size: clamp(19px, 4.6vw, 23px); line-height: 1.42; font-weight: 450; color: var(--text); min-height: 5.8em; max-height: 34vh; overflow-y: auto; transition: opacity .18s ease, transform .18s ease; scrollbar-width: none; }
.excuse::-webkit-scrollbar { display: none; }
.excuse.swap { opacity: 0; transform: translateY(4px); }
.excuse.copied { color: #fff; }
.excuse.loading #excuseText { color: var(--dim); }
.tip { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line2); padding: 2px 0 2px 10px; margin: 0 0 10px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.chip-btn { font-size: 13.5px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); background: transparent; transition: color .15s, border-color .15s; }
.chip-btn:hover { color: var(--text); border-color: #2b3757; }
.chip-btn:disabled { opacity: .4; pointer-events: none; }

.panic { padding: 0 4px; }
.panic-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.panic-level { color: var(--heat); font-weight: 600; font-variant-numeric: tabular-nums; transition: color .2s; }
.panic-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--heat) var(--fill, 25%), var(--line2) var(--fill, 25%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--heat) var(--fill, 25%), var(--line2) var(--fill, 25%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--text); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--line2), 0 0 18px color-mix(in srgb, var(--heat) 50%, transparent); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 4px solid var(--bg); box-shadow: 0 0 0 1px var(--line2); }

.exit { width: 100%; border-radius: 22px; padding: 18px 16px; background: var(--text); color: var(--accent-ink); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .08s ease, box-shadow .2s; box-shadow: 0 10px 40px -18px rgba(123, 147, 255, .55); }
.exit:active { transform: scale(.985); }
.exit-main { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.exit-sub { font-size: 12.5px; opacity: .6; }

.sheet-handle { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 12px; color: var(--muted); font-size: 13.5px; }
.sheet-handle .grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line2); }
.sheet-handle:hover { color: var(--text); }

/* Alt panel (detaylı motor) */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 20; backdrop-filter: blur(2px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.sheet.open { transform: none; pointer-events: auto; }
.sheet-inner { max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line2); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.step { margin: 10px 0 12px; }
.step-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.step-label b { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line2); font-size: 11.5px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { font-size: 14px; padding: 8px 13px; border-radius: 12px; border: 1px solid var(--line2); color: var(--muted); background: var(--bg2); white-space: nowrap; transition: all .12s; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--accent-ink); background: var(--text); border-color: var(--text); }
.chip small { opacity: .6; margin-left: 4px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 12px 0 6px; border-top: 1px solid var(--line); margin-top: 6px; cursor: pointer; }
.switch small { display: block; color: var(--dim); font-size: 12px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 24px; background: var(--line2); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-box { border-left: 2px solid var(--accent); padding-left: 12px; margin: 4px 0 8px; }
.input, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; font-size: 15px; color: var(--text); margin-top: 8px; resize: none; }
.input::placeholder, textarea::placeholder { color: var(--dim); }
.input:focus, textarea:focus { outline: none; border-color: #34426a; }
.primary { width: 100%; background: var(--text); color: var(--accent-ink); font-weight: 650; padding: 14px; border-radius: 14px; margin-top: 8px; }
.primary.sm { width: auto; padding: 8px 14px; margin: 0; font-size: 14px; border-radius: 11px; }
.primary:disabled { opacity: .5; }

/* Topluluk çekmecesi */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 40; background: var(--bg2); border-left: 1px solid var(--line2); transform: translateX(102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; padding: 0 16px; }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 10px; flex: none; }
.drawer-title { font-weight: 650; }
.drawer-sub { font-size: 12.5px; color: var(--dim); }
.compose { flex: none; }
.compose textarea { margin-top: 0; }
.compose-foot { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; font-size: 12.5px; color: var(--dim); }
.compose-foot #composeAs { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-filters { flex: none; display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.feed-filters .chip { padding: 6px 11px; font-size: 13px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line2); border-radius: 11px; padding: 3px; align-self: flex-start; }
.seg button { font-size: 13px; padding: 5px 12px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: var(--surface2); color: var(--text); }
.feed { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 calc(20px + var(--safe-b)); scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.post { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-text { font-size: 15.5px; line-height: 1.45; cursor: copy; word-wrap: break-word; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.post-tags span { font-size: 12px; color: var(--accent); }
.post-foot { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--dim); }
.post-foot .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-foot button { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.post-foot button svg { width: 16px; height: 16px; }
.post-foot button.on { color: var(--ok); }
.comments { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--line2); }
.comment { font-size: 14px; padding: 6px 0; }
.comment .who { font-size: 12px; color: var(--dim); }
.comment-form { display: flex; gap: 8px; margin-top: 6px; }
.comment-form .input { margin: 0; padding: 8px 10px; font-size: 14px; }
.empty, .feed-note { color: var(--dim); font-size: 14px; text-align: center; padding: 30px 10px; }
.more { display: block; margin: 14px auto 0; }

/* Modallar */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-box { width: min(420px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 22px; padding: 14px 16px 16px; }
.modal-box p { color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.card-modal img { display: block; width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0 12px; background: #000; }
.row { display: flex; gap: 10px; align-items: center; }
.row .primary { margin: 0; flex: 1; }
.msg { font-size: 13.5px; margin-top: 8px; color: var(--muted); }
.msg.err { color: #ff8f8f; }

.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; z-index: 80; background: var(--text); color: var(--accent-ink); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 550; pointer-events: none; transition: all .22s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { text-align: center; color: var(--muted); }

/* Gizli mod: ekran kısılır, marka gizlenir, sekme adı "Notlar" olur */
body.stealth .app { filter: brightness(.55) saturate(.4); }
body.stealth .brand-name, body.stealth .exit-sub { visibility: hidden; }
body.stealth .exit { box-shadow: none; }

@media (max-height: 640px) {
  .excuse { min-height: 4.4em; font-size: 18px; padding: 10px 0 8px; }
  .exit { padding: 13px; }
  .exit-main { font-size: 18px; }
  .top { height: 50px; }
}
@media (min-width: 900px) {
  .app { padding-top: 2vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
