/* ── GLOBAL OUTLINE RESET ── */
*, *::before, *::after,
*:focus, *:focus-visible, *:focus-within, *:active, *:hover {
  outline: none !important;
  outline-style: none !important;
  outline-width: 0 !important;
  outline-color: transparent !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* ── KAAHIN ── */

/* ── KRİTİK PATCH BLOĞU ── */

body::after {
  background: transparent !important;
  background-image: none !important;
  opacity: 0 !important;
  display: none !important;
  z-index: -1 !important;
}
body::before {
  background-image: none !important;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(80, 8, 16, 0.10) 0%, transparent 70%),
    #020203 !important;
  mask-image: none !important;
  animation: none !important;
  z-index: 0 !important;
}

html, body {
  background: var(--p-bg) !important;
  font-family: var(--p-font-mono) !important;
  font-size: 13px !important;
  color: var(--p-ink) !important;
}

.or-app          { display: none !important; }
.or-term         { display: none !important; }
.k2-corner-sigil { display: none !important; }

.proto-stage > .or-stage,
.proto-stage #orStage {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  z-index: 1 !important;
  background: #050507 !important;
}
.proto-stage #orCanvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.proto-stage .or-stage-meta,
#orStage .or-stage-meta { display: none !important; }

.k2-shape-rail.k3-hidden-rail {
  display: block !important;
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
  visibility: hidden !important;
}

/* ── RİTÜEL SAHNESİ ── */

.proto-stage #ritualStage,
.proto-stage > #ritualStage {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 50 !important;

  border-radius: 14px !important;
  overflow: hidden !important;
}

.proto-stage #ritualStage .ritual-frame {
  width: 92% !important;
  max-width: 92% !important;
  max-height: calc(100% - 70px) !important;
  margin: 0 !important;
  margin-bottom: 70px !important;
  padding: 20px 24px 16px !important;
  gap: 6px !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
}
.proto-stage #ritualStage .ritual-frame::-webkit-scrollbar { width: 4px; }
.proto-stage #ritualStage .ritual-frame::-webkit-scrollbar-thumb {
  background: rgba(233,32,56,.3);
  border-radius: 4px;
}

.proto-stage #ritualStage .r-title {
  font-family: var(--k-font-script, 'EB Garamond', 'Palatino Linotype', Palatino, Georgia, serif) !important;
  font-size: clamp(1.8rem, 3.6vw, 3rem) !important;
  line-height: 1.05 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

.proto-stage #ritualStage .r-eyebrow,
#ritualStage .r-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-size: 10px !important;
  letter-spacing: .42em !important;
  font-weight: 500 !important;
  color: rgba(233, 200, 200, 0.55) !important;
  text-transform: uppercase !important;
  margin: 0 0 6px 0 !important;
  min-height: 0 !important;
  line-height: 1 !important;
}
.proto-stage #ritualStage .r-eyebrow__l,
#ritualStage .r-eyebrow__l {
  font-family: inherit !important;
  font-size: inherit !important;
  letter-spacing: inherit !important;
  color: inherit !important;
  padding-left: 0 !important;
}
.proto-stage #ritualStage .r-eyebrow__l::before,
#ritualStage .r-eyebrow__l::before { content: none !important; display: none !important; }

.proto-stage #ritualStage .r-shape-badge,
#ritualStage .r-shape-badge {
  display: none !important;
}

.proto-stage #ritualStage .r-sub {
  font-size: 14px !important;
  line-height: 1.4 !important;
  margin: 4px auto 0 !important;
  text-align: center !important;
  display: block !important;
  min-height: 0 !important;
}
.proto-stage #ritualStage .r-divider {
  margin: 14px 0 8px !important;
}

.proto-stage #ritualStage .r-body {
  font-size: 0.9em;
}

.proto-stage #ritualStage .r-exit-bar {
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  gap: 6px !important;
}
.proto-stage #ritualStage .r-foot-exit {
  font-size: 10px !important;
  letter-spacing: .22em !important;
  padding: 4px 8px !important;
}
.proto-stage #ritualStage .r-exit-hint {
  font-size: 0 !important;
}
.proto-stage #ritualStage .r-exit-hint kbd {
  font-size: 10px !important;
  padding: 4px 8px !important;
}

/* Export bar küçült */
.proto-stage #ritualStage .r-export-bar {
  gap: 8px !important;
}
.proto-stage #ritualStage .r-export-btn {
  font-size: 10px !important;
  padding: 6px 12px !important;
}

body:has(#ritualStage.is-open) .or-term-body,
body:has(#ritualStage.is-open) .k2-stream,
body:has(#ritualStage.is-open) .proto-stream,
body:has(#ritualStage.is-open) .proto-rituals {
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto !important;
}

:root {
  --p-bg: #050306;
  --p-bg-2: #0a0608;
  --p-line: rgba(255, 255, 255, 0.08);
  --p-line-strong: rgba(255, 255, 255, 0.18);
  --p-ink: rgba(255, 255, 255, 0.92);
  --p-ink-dim: rgba(255, 255, 255, 0.55);
  --p-ink-mute: rgba(255, 255, 255, 0.35);
  --p-accent: #e92038;
  --p-accent-soft: rgba(233, 32, 56, 0.10);
  --p-accent-dim: rgba(233, 32, 56, 0.35);
  --p-accent-glow: rgba(233, 32, 56, 0.45);

  --p-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --p-font-serif: 'Marcellus', 'EB Garamond', serif;

  --p-dur: 280ms;
  --p-ease: cubic-bezier(.2, .8, .2, 1);

  --proto-topbar-h: 52px;
  --proto-hud-h: 96px;
  --pageview-pad: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--p-bg);
  color: var(--p-ink);
  font-family: var(--p-font-mono);
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-bg="ritual"]::before {
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(120, 16, 28, 0.12) 0%, transparent 65%),
    #020203 !important;
  animation: bg-quiet-breath 16s ease-in-out infinite !important;
}
body[data-bg="ritual"]::after {
  background-image: none !important;
  animation: none !important;
  opacity: 0 !important;
  display: none !important;
}

/* VEIN */
body[data-bg="vein"]::before {
  background:
    radial-gradient(ellipse 55% 45% at 30% 70%, rgba(120, 16, 28, 0.14) 0%, transparent 65%),
    #020203 !important;
  animation: bg-quiet-breath 18s ease-in-out infinite !important;
}
body[data-bg="vein"]::after {
  background-image: none !important; animation: none !important; opacity: 0 !important; display: none !important;
}

/* STORM */
body[data-bg="storm"]::before {
  background:
    radial-gradient(ellipse 60% 45% at 50% 25%, rgba(120, 16, 28, 0.13) 0%, transparent 65%),
    #020203 !important;
  animation: bg-quiet-breath 17s ease-in-out infinite !important;
}
body[data-bg="storm"]::after {
  background-image: none !important; animation: none !important; opacity: 0 !important; display: none !important;
}

body[data-bg="shrine"]::before {
  background:
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(80, 8, 16, 0.08) 0%, transparent 70%),
    #020203 !important;
  animation: bg-quiet-breath 20s ease-in-out infinite !important;
}
body[data-bg="shrine"]::after {
  background-image: none !important; animation: none !important; opacity: 0 !important; display: none !important;
}

@keyframes bg-quiet-breath {
  0%, 100% { opacity: 0.92; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
}

/* ARKAPLAN DEĞİŞTİR BUTONU */
.proto-bg-toggle {
  background: transparent;
  border: 1px solid var(--p-line);
  color: var(--p-ink-mute);
  width: 22px; height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 200ms var(--p-ease);
  margin-right: 4px;
}
.proto-rituals-head > span:first-child { margin-right: auto; }
.proto-rituals-head #protoDevResetProxy[hidden] { display: none; }
.proto-rituals-head #protoBgToggle { margin-right: 8px; }

.proto-dev-btn { position: relative; }
.proto-dev-badge {
  position: absolute;
  top: -5px; right: -5px;
  font-family: var(--p-font-mono, monospace);
  font-size: 7px;
  letter-spacing: .12em;
  background: var(--p-accent, #e92038);
  color: #fff;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
  font-weight: 700;
  pointer-events: none;
}
.proto-bg-toggle:hover {
  color: var(--p-accent);
  border-color: var(--p-accent-dim);
  background: var(--p-accent-soft);
}
.proto-proxy-btn.is-off { color: rgba(255,255,255,0.20); border-color: rgba(255,255,255,0.06); }
.proto-proxy-btn.is-on  { color: var(--p-accent); border-color: var(--p-accent-dim); }
.proto-bg-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 30px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(8, 5, 8, 0.92);
  border: 1px solid var(--p-line);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.proto-bg-menu.is-open { display: flex; }
.proto-bg-menu button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--p-ink-dim);
  font-family: var(--p-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 160ms var(--p-ease);
}
.proto-bg-menu button:hover {
  color: var(--p-ink);
  border-color: var(--p-line);
  background: rgba(255,255,255,0.03);
}
.proto-bg-menu button.is-active { color: var(--p-accent); }
.proto-bg-menu .sw {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(233, 32, 56, 0.18) 0%, rgba(233, 32, 56, 0.06) 35%, transparent 65%),
    linear-gradient(180deg, rgba(80, 10, 20, 0.45) 0%, rgba(20, 4, 8, 0.15) 35%, transparent 70%),
    var(--p-bg);
  z-index: 0;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* ── ANA GRID ── */
.proto-shell,
main.proto-shell {
  position: fixed !important;
  top:    calc(var(--proto-topbar-h) + var(--pageview-pad)) !important;
  right:  var(--pageview-pad) !important;
  bottom: calc(var(--proto-hud-h) + var(--pageview-pad)) !important;
  left:   var(--pageview-pad) !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 2;
  display: grid !important;
  grid-template-columns: 28% 1fr !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "rituals stage"
    "chat    stage" !important;
  column-gap: var(--pageview-pad) !important;
  row-gap: var(--pageview-pad) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
.proto-shell > .proto-rituals,
.proto-shell > .proto-chat,
.proto-shell > .proto-stage {
  min-width: 0 !important;
  min-height: 0 !important;
}

/* ── SOL-ÜST ── */
.proto-rituals {
  grid-area: rituals;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  position: relative;
}
.proto-rituals-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--p-ink-mute);
  padding: 0;
}
.proto-rituals-head .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--p-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--p-accent-glow);
  margin-right: 8px;
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}

.proto-rituals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 10px;
  align-items: start;
}

.proto-ritual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 2px 2px 0 2px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: transform 220ms var(--p-ease);
}

.proto-ritual-icon {
  position: relative;
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px;
  border-radius: 10px;
  background: rgba(8, 6, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
  transition:
    border-color 280ms var(--p-ease),
    box-shadow 280ms var(--p-ease);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.5);
}
.proto-ritual-icon img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
  opacity: 0.85;
  filter: contrast(1.1) brightness(0.95);
  transition: opacity 280ms var(--p-ease), filter 280ms var(--p-ease);
}

.proto-ritual-label {
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--p-ink-mute);
  font-weight: 500;
  transition: color 280ms var(--p-ease);
  white-space: nowrap;
  line-height: 1;
  margin-top: 2px;
}

.proto-ritual-icon {
  transition:
    border-color 700ms ease,
    box-shadow 700ms ease;
}
.proto-ritual:hover .proto-ritual-icon {
  border-color: rgba(233, 32, 56, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.5);
}
.proto-ritual:hover .proto-ritual-icon img {
  opacity: 1;
  filter: contrast(1.15) brightness(1);
}
.proto-ritual:hover .proto-ritual-label {
  color: var(--p-ink-dim);
}

.proto-ritual.is-active .proto-ritual-icon {
  border-color: rgba(233, 32, 56, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 18px rgba(233, 32, 56, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(233, 32, 56, 0.18);
  animation: proto-pulse-red 4s var(--p-ease) infinite;
}
.proto-ritual.is-active .proto-ritual-icon img {
  opacity: 1;
  filter: contrast(1.2) brightness(1.05);
}
.proto-ritual.is-active .proto-ritual-label {
  color: var(--p-ink);
  text-shadow: 0 0 10px rgba(233, 32, 56, 0.35);
}
@keyframes proto-pulse-red {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      inset 0 0 18px rgba(233, 32, 56, 0.18),
      0 8px 24px rgba(0, 0, 0, 0.6),
      0 0 24px rgba(233, 32, 56, 0.12);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.10),
      inset 0 0 26px rgba(233, 32, 56, 0.30),
      0 8px 28px rgba(0, 0, 0, 0.65),
      0 0 34px rgba(233, 32, 56, 0.22);
  }
}

/* ── SOL-ALT ── */
.proto-chat {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  min-height: 0;
  position: relative;
  overflow: visible;
}

.proto-chat::before {
  content: '';
  position: absolute;
  inset: -16px 0 0 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(120, 16, 28, 0.08) 0%, transparent 70%);
  filter: blur(6px);
  opacity: 0.7;
  animation: protoChatBreath 12s ease-in-out infinite;
}
@keyframes protoChatBreath {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.8; }
}
.proto-chat > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .proto-chat::before { animation: none; }
}

.proto-stream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px 28px 22px 28px;
  background: transparent;
  border: none;
  scrollbar-width: none;
  mask-image:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 14%, #000 38%, #000 100%);
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 14%, #000 38%, #000 100%);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  position: relative;
}
.proto-stream .or-line {
  padding-left: 6px !important;
  padding-right: 6px !important;
  box-sizing: border-box;
}
.proto-stream::-webkit-scrollbar { display: none; }

.proto-stream #orTranscript,
.proto-chat #orTranscript,
.proto-stream .k2-stream,
.proto-chat .k2-stream,
#orTranscript.k2-stream {
  position: static !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: stretch !important;
  gap: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  overflow-y: auto !important;
  z-index: auto !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}

.proto-stream .k2-stream-zone {
  display: contents !important;
}

.proto-stream .or-line,
.proto-chat .or-line {
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
  font-family: var(--p-font-serif) !important;
  font-size: 19px !important;
  line-height: 1.55 !important;
  text-shadow: 0 0 24px rgba(233, 32, 56, 0.08) !important;
}

.proto-stream .or-line .meta,
.proto-chat .or-line .meta,
.proto-stream .or-line .time,
.proto-chat .or-line .time {
  display: none !important;
}

.proto-stream .or-line .body,
.proto-chat .or-line .body {
  font-family: var(--p-font-serif) !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
  color: var(--p-ink) !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.proto-stream .or-line.ai,
.proto-chat .or-line.ai,
.proto-stream .or-line:not(.user):not(.system),
.proto-chat .or-line:not(.user):not(.system) {
  text-align: left !important;
}
.proto-stream .or-line.ai .body,
.proto-chat .or-line.ai .body {
  font-family: 'EB Garamond', 'Marcellus', serif !important;
  font-style: italic !important;
  font-size: 21px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: 0.005em !important;
  color: var(--p-ink) !important;
}
.proto-stream .or-line.ai .body::first-letter,
.proto-chat .or-line.ai .body::first-letter {
  font-family: 'Marcellus', 'EB Garamond', serif !important;
  color: var(--p-accent) !important;
  font-size: 1.65em !important;
  font-weight: 600 !important;
  font-style: normal !important;
  text-shadow: 0 0 16px rgba(233, 32, 56, 0.45) !important;
  margin-right: 2px !important;
  line-height: 1 !important;
}

.proto-stream .or-line.user,
.proto-chat .or-line.user {
  text-align: right !important;
}
.proto-stream .or-line.user .body,
.proto-chat .or-line.user .body {
  font-style: normal !important;
  font-size: 21px !important;
  color: var(--p-ink-dim) !important;
}
.proto-stream .or-line.user .body::after,
.proto-chat .or-line.user .body::after {
  content: ' ·' !important;
  color: var(--p-accent) !important;
  opacity: 1 !important;
}

/* INPUT SATIRI */
.proto-input-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 12px 22px;
  margin: 0;
  min-height: 64px;
  flex: 0 0 auto;
  flex-shrink: 0;
  background: rgba(10, 8, 10, 0.5);
  border: 1px solid var(--p-accent-dim);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--p-dur) var(--p-ease),
              border-color var(--p-dur) var(--p-ease),
              box-shadow var(--p-dur) var(--p-ease);
  animation: proto-input-pulse 4s var(--p-ease) infinite;
  flex-wrap: nowrap;
  overflow: visible;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

/* ── INPUT ── */

.proto-input-row::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(233, 32, 56, 0.0) 15%,
    rgba(233, 32, 56, 0.55) 50%,
    rgba(233, 32, 56, 0.0) 85%,
    transparent 100%);
  pointer-events: none;
  z-index: 0;
  filter: blur(0.5px);
  opacity: 0.7;
  animation: proto-input-sheen 7s ease-in-out infinite;
}
@keyframes proto-input-sheen {
  0%, 100% { transform: translateX(-25%); opacity: 0.25; }
  50%      { transform: translateX(25%);  opacity: 0.8; }
}
.proto-input-row:focus-within::before {
  opacity: 0;
}
.proto-input-row > * { position: relative; z-index: 1; }

.proto-input-row::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 35%,
    rgba(233, 32, 56, 0.35) 47%,
    rgba(255, 200, 215, 0.75) 50%,
    rgba(233, 32, 56, 0.35) 53%,
    transparent 65%,
    transparent 100%
  );
  background-size: 260% 100%;
  background-repeat: no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0.55;
  filter: drop-shadow(0 0 2px rgba(233, 32, 56, 0.45));
  animation: proto-input-idle-train 7s linear infinite;
  transition: opacity 600ms ease, background 600ms ease;
  z-index: 0;
}
@keyframes proto-input-idle-train {
  0%   { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}

.proto-input-row:focus-within::after {
  animation: proto-input-magic-breathe 3.6s ease-in-out infinite;
  background:
    radial-gradient(ellipse 50% 110% at 0% 50%,
      rgba(233, 32, 56, 0.28) 0%,
      rgba(233, 32, 56, 0.10) 30%,
      transparent 65%),
    radial-gradient(ellipse 50% 110% at 100% 50%,
      rgba(233, 32, 56, 0.28) 0%,
      rgba(233, 32, 56, 0.10) 30%,
      transparent 65%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 25%);
  background-size: auto;
  -webkit-mask: none;
          mask: none;
  padding: 0;
  opacity: 1;
  filter: blur(0.5px);
}
@keyframes proto-input-magic-breathe {
  0%, 100% { opacity: 0.7; filter: blur(0.5px); }
  50%      { opacity: 1;   filter: blur(1.5px); }
}

.proto-input-row:focus-within #orInput {
  animation: proto-input-text-pulse 3.2s ease-in-out infinite;
}
@keyframes proto-input-text-pulse {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50%      { text-shadow: 0 0 8px rgba(233, 32, 56, 0.28); }
}

.proto-input-row:focus-within::before {
  opacity: 1;
  height: 1px;
  bottom: auto;
  top: 1px;
  left: 12%;
  right: 12%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.0) 15%,
    rgba(255, 230, 235, 0.55) 50%,
    rgba(255, 255, 255, 0.0) 85%,
    transparent 100%);
  animation: proto-input-magic-shine 5s ease-in-out infinite;
}
@keyframes proto-input-magic-shine {
  0%, 100% { transform: translateX(-15%); opacity: 0.3; }
  50%      { transform: translateX(15%);  opacity: 0.75; }
}
@keyframes proto-input-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(233, 32, 56, 0.06),
      0 4px 14px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(233, 32, 56, 0.14),
      0 6px 18px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}
.proto-input-row:focus-within {
  border-color: rgba(233, 32, 56, 0.5);
  background: rgba(15, 8, 10, 0.6);
  transform: none !important;
  box-shadow:
    0 0 0 1px rgba(233, 32, 56, 0.18),
    0 6px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.proto-input-row #orInput {
  flex: 1 1 auto;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-family: 'EB Garamond', 'Palatino Linotype', Palatino, Georgia, serif !important;
  font-size: 19.66px !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
  padding: 6px 4px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  position: static !important;
}
.proto-input-row #orInput::placeholder {
  color: var(--p-ink-mute) !important;
  font-style: italic !important;
  letter-spacing: 0.04em !important;
  font-family: 'EB Garamond', 'Palatino Linotype', Palatino, Georgia, serif !important;
  font-size: 16.38px !important;
}

.proto-input-btn,
.proto-input-row #orSend,
.proto-input-row #protoStones {
  flex: 0 0 36px !important;
  min-width: 36px !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 50% !important;
  color: var(--p-ink-dim) !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: all var(--p-dur) var(--p-ease);
  position: static !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.proto-input-btn:hover,
.proto-input-row #protoStones:hover {
  color: var(--p-accent) !important;
  background: var(--p-accent-soft) !important;
  border-color: var(--p-accent-dim) !important;
}
.proto-input-row #orSend {
  background: var(--p-accent-soft) !important;
  border-color: var(--p-accent-dim) !important;
  color: var(--p-ink) !important;
}
.proto-input-row #orSend:hover {
  background: var(--p-accent) !important;
  border-color: var(--p-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 18px var(--p-accent-glow) !important;
}
.proto-input-row #orSend .or-send-arrow {
  display: none !important;
}

/* ── KÂHİN KONUŞURKEN ── */
.kaahin-wave {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  pointer-events: none;
  user-select: none;
  position: relative;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition:
    opacity 1200ms ease-out,
    max-width 800ms ease-out;
}
.proto-input-row.is-speaking #orInput {
  /* Input fade-out */
  opacity: 0;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  transition: opacity 400ms ease-out, width 400ms ease-out, padding 400ms ease-out;
}
.proto-input-row #orInput {
  transition: opacity 600ms ease-out 200ms;
}
.proto-input-row.is-speaking .kaahin-wave {
  opacity: 1;
  max-width: 100%;
}

.kaahin-wave .kw-bar {
  display: none !important;
}

/* Yeni SVG wave wrapper */
.kw-svg-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kw-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.kw-svg-wrap .kw-path {
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 0.5 3.5;
  filter: drop-shadow(0 0 4px rgba(233, 32, 56, 0.65));
}
.kw-svg-wrap .kw-path-1 { stroke: rgba(255, 180, 190, 0.95); animation: kw-wave-1 2.2s ease-in-out infinite; }
.kw-svg-wrap .kw-path-2 { stroke: rgba(255, 110, 130, 0.88); animation: kw-wave-2 2.8s ease-in-out infinite; }
.kw-svg-wrap .kw-path-3 { stroke: rgba(233, 32, 56, 0.85);   animation: kw-wave-3 3.4s ease-in-out infinite; }
.kw-svg-wrap .kw-path-4 { stroke: rgba(255, 80, 105, 0.78);  animation: kw-wave-4 2.5s ease-in-out infinite; }
.kw-svg-wrap .kw-path-5 { stroke: rgba(200, 30, 50, 0.7);    animation: kw-wave-5 3.0s ease-in-out infinite; }

@keyframes kw-wave-1 {
  0%, 100% { transform: translateY(0)    scaleY(1);    opacity: 0.95; }
  50%      { transform: translateY(-2px) scaleY(0.6);  opacity: 0.65; }
}
@keyframes kw-wave-2 {
  0%, 100% { transform: translateY(1px)  scaleY(0.7);  opacity: 0.75; }
  50%      { transform: translateY(-3px) scaleY(1.15); opacity: 0.95; }
}
@keyframes kw-wave-3 {
  0%, 100% { transform: translateY(-1px) scaleY(0.85); opacity: 0.7; }
  50%      { transform: translateY(2px)  scaleY(0.5);  opacity: 0.5; }
}
@keyframes kw-wave-4 {
  0%, 100% { transform: translateY(2px)  scaleY(0.55); opacity: 0.6; }
  50%      { transform: translateY(-2px) scaleY(1.0);  opacity: 0.85; }
}
@keyframes kw-wave-5 {
  0%, 100% { transform: translateY(-2px) scaleY(0.9);  opacity: 0.7; }
  50%      { transform: translateY(1px)  scaleY(0.45); opacity: 0.55; }
}

/* ── KÂHİN DÜŞÜNÜYOR ── */
.proto-chat .or-think-mystic,
.proto-stream .or-think-mystic {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  min-height: 24px;
  width: 100%;
  max-width: 280px;
}

.proto-chat .or-think-ring,
.proto-stream .or-think-ring,
.proto-chat .or-think-ring--mid,
.proto-stream .or-think-ring--mid {
  display: none !important;
}

.proto-chat .or-think-mystic .or-think-sigil,
.proto-stream .or-think-mystic .or-think-sigil {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-family: 'Marcellus', 'Cinzel', serif !important;
  font-size: 12px !important;
  color: rgba(255, 200, 210, 0.92) !important;
  text-shadow:
    0 0 6px rgba(233, 32, 56, 0.85),
    0 0 14px rgba(233, 32, 56, 0.45) !important;
  animation:
    kahin-think-pulse 1.6s ease-in-out infinite !important;
  pointer-events: none;
}

.proto-chat .or-think-mystic .or-think-trail,
.proto-stream .or-think-mystic .or-think-trail {
  flex: 1 1 auto;
  width: auto !important;
  height: 1px !important;
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(233, 32, 56, 0.08) 0%,
      rgba(233, 32, 56, 0.22) 50%,
      rgba(233, 32, 56, 0.08) 100%) !important;
  background-size: 100% 100% !important;
  animation: none !important;
  opacity: 1 !important;
  overflow: visible;
}
.proto-chat .or-think-mystic .or-think-trail::after,
.proto-stream .or-think-mystic .or-think-trail::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 35%;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 140, 150, 0.0) 10%,
    rgba(255, 180, 190, 0.85) 50%,
    rgba(255, 140, 150, 0.0) 90%,
    transparent 100%);
  border-radius: 2px;
  filter: blur(0.4px);
  animation: kahin-think-scan 2.1s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
  box-shadow:
    0 0 8px rgba(233, 32, 56, 0.55),
    0 0 16px rgba(233, 32, 56, 0.25);
}
.proto-chat .or-think-mystic .or-think-trail::before,
.proto-stream .or-think-mystic .or-think-trail::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(233, 32, 56, 0.12) 50%,
    transparent 100%);
  opacity: 0.55;
}

@keyframes kahin-think-pulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
    text-shadow:
      0 0 4px rgba(233, 32, 56, 0.55),
      0 0 10px rgba(233, 32, 56, 0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    text-shadow:
      0 0 10px rgba(233, 32, 56, 1),
      0 0 20px rgba(233, 32, 56, 0.6);
  }
}
@keyframes kahin-think-scan {
  0%   { transform: translateX(-20%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(220%); opacity: 0; }
}

.proto-stream .or-line--thinking .body::first-letter,
.proto-chat .or-line--thinking .body::first-letter {
  font-family: inherit !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  text-shadow: none !important;
  margin-right: 0 !important;
}

/* ── SAĞ ── */
.proto-stage {
  grid-area: stage;
  position: relative;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(28, 18, 24, 0.95);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.proto-stage #orCanvas,
.proto-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.proto-stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.proto-stage-meta {
  position: absolute;
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--p-ink-mute);
  pointer-events: none;
}
.proto-stage-meta--tl { top: 16px; left: 18px; }
.proto-stage-meta--tr { top: 16px; right: 18px; }
.proto-stage-meta--bl { bottom: 16px; left: 18px; }
.proto-stage-meta--br { bottom: 16px; right: 18px; }
.proto-stage-meta .accent { color: var(--p-accent); }

/* ── STAGE META ── */
.proto-stage-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.k-meta-divider {
  color: rgba(255, 255, 255, 0.14);
  font-size: 8px;
}
.k-meta-text {
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 220, 230, 0.42);
}
.k-pulse-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--p-accent);
  box-shadow: 0 0 6px rgba(233, 32, 56, 0.6);
  animation: k-meta-pulse 3.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes k-meta-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
/* BR */
.k-meta-coord {
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 200, 210, 0.38);
}

.k-shape-bar--mini {
  width: 60px !important;
  height: 2px !important;
  margin-left: 0 !important;
}

.k-shape-timer {
  font-family: var(--p-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 220, 230, 0.7);
  min-width: 26px;
  display: inline-block;
}
.k-shape-bar {
  display: inline-block;
  position: relative;
  width: 52px;
  height: 2px;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  overflow: hidden;
}
.k-shape-bar--solo {
  width: 110px;
  height: 2px;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.06);
}
.k-shape-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(233, 32, 56, 0.45), rgba(255, 180, 195, 0.95));
  box-shadow: 0 0 6px rgba(233, 32, 56, 0.5);
  transition: width 300ms linear;
}

.k-br-cycle {
  transition: opacity 420ms ease;
}
.k-br-cycle.is-swap { opacity: 0; }

.proto-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

.proto-stage-mood { display: none !important; }

/* HUD MOOD pill */
.hud-mood-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: rgba(8, 5, 8, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-family: var(--p-font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 220, 230, 0.75);
}
.hud-mood-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--p-accent);
  box-shadow: 0 0 6px var(--p-accent-glow);
}

/* Topbar + HUD üstte kalsın */
.inlab-topbar { z-index: 200 !important; }
#orHud { z-index: 200 !important; }

#orHud .inlab-hud__home-btn,
#orHud .inlab-hud__info-btn,
#orHud .hud-action-btn,
#orHud .set-tg,
#orHud .hud-sound-btn,
#orHud .hud-shape-btn,
#orHud .nm-btn {
  border-radius: 4px !important;
}

/* ── GİZLİ KAAHIN2 ELEMENTLERİ ── */
.k2-shape-rail.k3-hidden-rail,
.shape-drawer.k3-hidden:not(.is-open),
.or-shaper.k3-hidden,
.or-stones.k3-hidden {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.proto-input-row .k2-stones-trigger {
  display: none !important;
}

.k2-stones-list {
  z-index: 300 !important;
}

.fal-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 50;
  background:
    radial-gradient(circle at 30% 0%, rgba(233, 32, 56, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, rgba(14, 8, 12, 0.97) 0%, rgba(6, 3, 6, 0.98) 100%);
  border: 1px solid rgba(233, 32, 56, 0.32);
  border-radius: 14px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.fal-pop[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.fal-pop__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fal-pop__tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fal-pop__tabs::-webkit-scrollbar { display: none; }
.fal-pop__tab {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.62);
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.fal-pop__tab:hover {
  border-color: rgba(233, 32, 56, 0.45);
  color: rgba(255, 255, 255, 0.9);
}
.fal-pop__tab.is-active {
  background: rgba(233, 32, 56, 0.16);
  border-color: rgba(233, 32, 56, 0.7);
  color: #fff;
}
.fal-pop__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.fal-pop__close:hover {
  border-color: rgba(233, 32, 56, 0.6);
  color: #fff;
  background: rgba(233, 32, 56, 0.12);
}
.fal-pop__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 32, 56, 0.3) transparent;
  padding-right: 2px;
}
.fal-pop__list::-webkit-scrollbar { width: 4px; }
.fal-pop__list::-webkit-scrollbar-thumb { background: rgba(233, 32, 56, 0.3); border-radius: 4px; }
.fal-pop__stone {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
  display: flex;
  align-items: center;
}
.fal-pop__stone:hover {
  border-color: rgba(233, 32, 56, 0.65);
  color: #fff;
  background: rgba(233, 32, 56, 0.06);
  box-shadow: 0 0 18px rgba(233, 32, 56, 0.18);
  transform: translateY(-1px);
}
.fal-pop__stone:active {
  transform: translateY(0);
}
@media (max-width: 560px) {
  .fal-pop { padding: 10px; max-height: 55vh; }
  .fal-pop__list { grid-template-columns: 1fr; }
  .fal-pop__stone { font-size: 13px; padding: 10px 12px; min-height: 48px; }
  .fal-pop__tab { font-size: 10px; padding: 6px 10px; }
}

/* Input butonu aktif durum */
.proto-input-btn[aria-expanded="true"] {
  color: #E92038;
  background: rgba(233, 32, 56, 0.12);
}

.k2-stones-panel {
  position: fixed !important;
  z-index: 9999 !important;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(460px, 72vh);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(233, 32, 56, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, rgba(14, 8, 12, 0.97) 0%, rgba(6, 3, 6, 0.98) 100%);
  border: 1px solid rgba(233, 32, 56, 0.38);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, .7),
    0 0 32px rgba(233, 32, 56, .18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.96);
  pointer-events: none;
  transform-origin: bottom right;
  transition:
    opacity 260ms cubic-bezier(.22, 1, .36, 1),
    transform 320ms cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear 320ms;
}
.k2-stones-panel[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity 260ms cubic-bezier(.22, 1, .36, 1),
    transform 320ms cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear 0s;
}

/* HEAD */
.k2-stones-panel-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.k2-stones-panel-head::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233,32,56,.5), transparent);
}
.k2-stones-panel-title {
  font-family: var(--k-font-mono, 'Space Mono', monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: #fff;
}
.k2-stones-panel-sub {
  font-family: var(--k-font-serif, Georgia, serif);
  font-size: 10px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.04em;
}
.k2-stones-panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 200ms ease;
}
.k2-stones-panel-close:hover {
  background: rgba(233, 32, 56, 0.18);
  border-color: rgba(233, 32, 56, 0.5);
  color: #fff;
  transform: rotate(90deg);
}

/* TABS */
.k2-stones-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 8px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}
.k2-stones-tabs::-webkit-scrollbar { display: none; }
.k2-stones-tab {
  flex: 1 1 0;
  min-width: 56px;
  padding: 8px 4px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 220ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  position: relative;
}
.k2-tab-glyph {
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  transition: all 240ms ease;
}
.k2-tab-label {
  font-family: var(--k-font-mono, 'Space Mono', monospace);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
}
.k2-stones-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}
.k2-stones-tab:hover .k2-tab-glyph {
  opacity: 1;
  transform: scale(1.15);
}
.k2-stones-tab.is-active {
  color: #fff;
  border-bottom-color: #E92038;
}
.k2-stones-tab.is-active .k2-tab-glyph {
  color: #E92038;
  opacity: 1;
  text-shadow: 0 0 12px rgba(233, 32, 56, 0.6);
}

/* ITEMS */
.k2-stones-items {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 32, 56, 0.3) transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.k2-stones-items::-webkit-scrollbar { width: 4px; }
.k2-stones-items::-webkit-scrollbar-thumb {
  background: rgba(233, 32, 56, 0.3);
  border-radius: 2px;
}
.k2-stones-item {
  margin: 0;
  padding: 0;
}
.k2-stones-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  cursor: pointer;
  transition: all 220ms cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
}
.k2-stones-item-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 220ms ease;
}
.k2-stones-item-num {
  flex: 0 0 auto;
  font-family: var(--k-font-mono, 'Space Mono', monospace);
  font-size: 9px;
  font-weight: 600;
  color: rgba(233, 32, 56, 0.65);
  letter-spacing: 0.05em;
  min-width: 18px;
}
.k2-stones-item-text {
  flex: 1 1 auto;
  font-family: var(--k-font-mono, 'Space Mono', monospace);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  white-space: normal;
}
.k2-stones-item-arrow {
  flex: 0 0 auto;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.25);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 220ms cubic-bezier(.22, 1, .36, 1);
}
.k2-stones-item-btn:hover {
  background: rgba(233, 32, 56, 0.10);
  border-color: rgba(233, 32, 56, 0.32);
  color: #fff;
  transform: translateX(2px);
}
.k2-stones-item-btn:hover::before {
  background: #E92038;
}
.k2-stones-item-btn:hover .k2-stones-item-num {
  color: #E92038;
}
.k2-stones-item-btn:hover .k2-stones-item-arrow {
  opacity: 1;
  transform: translateX(0);
  color: #E92038;
}
.k2-stones-item-btn:focus-visible {
  outline: 1px solid rgba(233, 32, 56, 0.5);
  outline-offset: 1px;
}
.k2-stones-empty {
  padding: 22px 14px;
  text-align: center;
  font-family: var(--k-font-serif, Georgia, serif);
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.35);
}

/* FOOT */
.k2-stones-panel-foot {
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}
.k2-stones-foot-hint {
  font-family: var(--k-font-serif, Georgia, serif);
  font-size: 10px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.04em;
}

/* MOBİL */
@media (max-width: 900px) {
  .k2-stones-panel {
    width: calc(100vw - 16px);
    max-height: min(60vh, 400px);
  }
  .k2-tab-glyph { font-size: 14px; }
  .k2-tab-label { font-size: 7.5px; letter-spacing: 0.14em; }
  .k2-stones-item-text { font-size: 11.5px; }
  .k2-stones-item-btn { padding: 9px 10px; gap: 10px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .proto-shell,
  main.proto-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr !important;
    grid-template-areas:
      "rituals"
      "stage"
      "chat" !important;
    row-gap: var(--pageview-pad) !important;
    column-gap: 0 !important;
  }
  :root { --pageview-pad: 14px; }
  .proto-shell,
  main.proto-shell {
    grid-template-rows: auto minmax(200px, 1fr) auto !important;
  }
  .proto-shell > .proto-stage { min-height: 200px !important; }
  .proto-stream { max-height: clamp(96px, 20vh, 220px); }

  .proto-input-row {
    flex-wrap: nowrap !important;
    padding: 10px 12px 10px 14px !important;
    gap: 5px !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  .proto-input-row #orInput {
    min-width: 0 !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    font-size: 16px !important;
  }
  .proto-input-row #orSend,
  .proto-input-row #protoStones {
    flex: 0 0 34px !important;
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
  }
  .proto-input-row #orSend {
    animation: proto-send-pulse-mobile 2.4s ease-in-out infinite !important;
  }
  @keyframes proto-send-pulse-mobile {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233,32,56,0); transform: scale(1); }
    50%      { box-shadow: 0 0 10px rgba(233,32,56,.3); transform: scale(1); }
  }
  .kaahin-wave { display: none !important; }
}

.proto-input-row #orSend {
  animation: proto-send-pulse 2.4s ease-in-out infinite;
}
@keyframes proto-send-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(233, 32, 56, 0.0),
                inset 0 0 0 0 rgba(255, 255, 255, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(233, 32, 56, 0.12),
                0 0 14px rgba(233, 32, 56, 0.35),
                inset 0 0 6px rgba(255, 180, 195, 0.15);
    transform: scale(1.06);
  }
}
.proto-input-row #orSend:hover {
  animation: none;
}

/* ── HUD ── */

#orHud .hud-center {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  height: 100% !important;
  gap: 0 !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

#orHud .hud-seg {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 18px 6px !important;
  gap: 6px !important;
  height: 100% !important;
  min-width: 90px !important;
  position: relative;
  border: none !important;
  box-sizing: border-box !important;
}

#orHud .hud-seg:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

#orHud .hud-seg .hud-lbl {
  font-family: var(--or-pp, 'Poppins', sans-serif) !important;
  font-size: .48rem !important;
  letter-spacing: .28em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.42) !important;
  line-height: 1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  text-align: center !important;
  display: block !important;
}

#orHud .hud-seg .hud-canvas-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 24px !important;
}
#orHud .hud-seg canvas,
#orHud .hud-seg .hud-breath-bars {
  display: block !important;
  max-height: 24px !important;
}

#orHud #bmVoiceSeg { min-width: 200px !important; }
#orHud #bmVoiceSeg canvas#bmVoice {
  width: 180px !important;
  height: 24px !important;
}
#orHud .hud-seg canvas#bmHeart {
  width: 110px !important;
  height: 24px !important;
}

/* Mood pill */
#orHud .hud-mood-seg .hud-mood-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--or-pp, 'Poppins', sans-serif);
  font-size: .58rem;
  letter-spacing: .14em;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  line-height: 1;
}

#orHud .hud-grp-action { padding: 8px 14px !important; min-width: auto !important; }
#orHud .hud-grp-action::after { display: block !important; }

#orHud .hud-divider { display: none !important; }

/* ── TÜRKÇE KARAKTER FIX ── */
body,
body * {
}
.inlab-hud__title-text,
#orHud .inlab-hud__title-text {
  font-family: 'Steelfish', 'Bebas Neue', 'Oswald', 'Impact', sans-serif !important;
  letter-spacing: .01em !important;
}
.inlab-hud-info-row__label,
[class*="steelfish"],
.or-sf,
.r-eyebrow,
.r-eyebrow__l,
.r-title {
  font-family: 'Bebas Neue', 'Oswald', 'Steelfish', 'Impact', sans-serif !important;
  letter-spacing: 0.04em;
}
.kk-title,
.k-title {
  font-family: 'Marcellus', 'EB Garamond', Georgia, serif !important;
}

/* ── KAAHIN INTRO OVERLAY ── */
#kaahinIntro {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.88) 60%, rgba(2,2,2,.96) 100%),
    url('../images/kaahin-intro-bg.webp') center/cover no-repeat,
    #020202;
  animation: kkIntroBreath 18s ease-in-out infinite;
  z-index: 8200;
  transition: opacity .7s ease, visibility .7s ease;
}
@keyframes kkIntroBreath {
  0%, 100% { background-size: auto, 108% auto, auto; background-position: center, 50% 50%, center; }
  50%      { background-size: auto, 114% auto, auto; background-position: center, 52% 48%, center; }
}
#kaahinIntro.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#kaahinIntro::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0px 1px, transparent 1px 3px);
  mix-blend-mode: overlay; opacity: .6; z-index: 0;
}
#kaahinIntro > * { position: relative; z-index: 1; }

/* ── RİTÜEL IZGARASI · TABLET ── */
@media (min-width: 600px) and (max-width: 900px) {
  .proto-rituals-grid { grid-template-columns: repeat(8, 1fr); gap: 8px; }
}
@media (max-width: 900px) and (max-height: 760px) {
  .proto-shell > .proto-rituals { min-height: auto !important; }
  .proto-shell,
  main.proto-shell { grid-template-rows: auto minmax(120px, 1fr) auto !important; }
  .proto-shell > .proto-stage { min-height: 120px !important; }
  .proto-rituals-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
  .proto-ritual-icon { padding: 3px; border-radius: 8px; }
  .proto-ritual-label { font-size: 7px; letter-spacing: .1em; }
  .proto-stream { max-height: 18vh; }
  .proto-stream .or-line, .proto-chat .or-line { font-size: 16px !important; }
  .proto-input-row { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .fal-pop {
    position: fixed;
    top: calc(var(--proto-topbar-h) + 8px);
    bottom: auto;
    left: var(--pageview-pad);
    right: auto;
    width: min(420px, calc(100vw - 2 * var(--pageview-pad)));
    max-height: calc(100vh - var(--proto-topbar-h) - var(--proto-hud-h) - 16px);   /* HUD'un altına girmesin */
    z-index: 9300;
  }
}
@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .proto-shell,
  main.proto-shell {
    grid-template-columns: minmax(0, 52%) 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "rituals stage"
      "chat    stage" !important;
    column-gap: var(--pageview-pad) !important;
    row-gap: 10px !important;
  }
  .proto-shell > .proto-stage { min-height: 0 !important; }
  .proto-stream { max-height: none; }
}

.ritual-stage.is-fullscreen .r-exit-bar {
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}
.ritual-stage.is-fullscreen .r-foot-exit {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .18em;
}
.ritual-stage.is-fullscreen .r-foot-exit__label { display: inline; }
@media (pointer: coarse) { .ritual-stage .r-exit-hint { display: none; } }
.ritual-stage.is-fullscreen .r-foot-exit__x { width: auto; height: auto; padding-left: 0; }

@media (pointer: coarse) {
  .proto-rituals-head .proto-bg-toggle {
    position: relative;
    width: 28px;
    height: 28px;
    margin-right: 16px;
    font-size: 11px;
  }
  .proto-rituals-head .proto-bg-toggle:last-child { margin-right: 8px; }
  .proto-rituals-head .proto-bg-toggle::after {
    content: '';
    position: absolute;
    inset: -8px;
  }
  .proto-input-row #orSend,
  .proto-input-row #protoStones { position: relative !important; }
  .proto-input-row #orSend::after,
  .proto-input-row #protoStones::after {
    content: '';
    position: absolute;
    inset: -5px;
  }
}

.seg-sound, .seg-music, .seg-shape,
.hud-seg.seg-sound, .hud-seg.seg-music, .hud-seg.seg-shape,
[data-tg="sound"], #bgMusicToggle, #shapeDrawerTrigger,
.hud-sound-btn--info,
.inlab-hud__actions .seg-sound,
.inlab-hud__actions .seg-music,
.inlab-hud__actions .seg-shape,
#orHud .hud-seg.seg-sound,
#orHud .hud-seg.seg-music,
#orHud .hud-seg.seg-shape,
#orHud .inlab-hud__actions .hud-seg.hud-seg--in-actions.seg-sound,
#orHud .inlab-hud__actions .hud-seg.hud-seg--in-actions.seg-music,
#orHud .inlab-hud__actions .hud-seg.hud-seg--in-actions.seg-shape { display: none !important; visibility: hidden !important; }

@media (max-width: 720px) {
  #orHud .hud-seg.seg-breath-box,
  #orHud #bmVoiceSeg { display: none !important; }
  #orHud .hud-center .hud-seg { min-width: 0 !important; }
}

.proto-stream #orTranscript,
.proto-chat #orTranscript {
  justify-content: flex-start !important;
  overscroll-behavior: contain;
}
.proto-stream #orTranscript > .or-line:first-child,
.proto-chat #orTranscript > .or-line:first-child { margin-top: auto !important; }

/* ── Satır-içi stillerden taşındı ── */
#k2StonesTrigger { position: fixed; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }
