.atsiz-sohbet {
	--atsiz-bg: #faf6ee;
	--atsiz-surface: #ffffff;
	--atsiz-ink: #1f1a14;
	--atsiz-muted: #6b6153;
	--atsiz-line: #e2d8c6;
	--atsiz-accent: #8b1e1e;
	--atsiz-accent-ink: #ffffff;
	--atsiz-user: #efe6d6;
	font-family: Georgia, "Times New Roman", serif;
	color: var(--atsiz-ink);
	line-height: 1.6;
	box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
	.atsiz-sohbet {
		--atsiz-bg: #1b1814;
		--atsiz-surface: #24201b;
		--atsiz-ink: #ece5d8;
		--atsiz-muted: #a99d8a;
		--atsiz-line: #3a342c;
		--atsiz-accent: #c0443f;
		--atsiz-user: #312b24;
	}
}
.atsiz-sohbet *, .atsiz-sohbet *::before, .atsiz-sohbet *::after { box-sizing: inherit; }

.atsiz-panel {
	display: flex;
	flex-direction: column;
	background: var(--atsiz-bg);
	border: 1px solid var(--atsiz-line);
	border-radius: 10px;
	overflow: hidden;
}
.atsiz-sohbet--inline .atsiz-panel { height: min(70vh, 640px); margin: 1.5em 0; }

.atsiz-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--atsiz-accent);
	color: var(--atsiz-accent-ink);
}
.atsiz-title { font-weight: bold; flex: 1; letter-spacing: .02em; }
.atsiz-head button {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .5);
	color: inherit;
	border-radius: 6px;
	padding: 2px 8px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.atsiz-close { order: 2; font-size: 18px !important; line-height: 1; }

.atsiz-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.atsiz-msg { max-width: 90%; padding: 10px 13px; border-radius: 10px; font-size: 15.5px; overflow-wrap: anywhere; }
.atsiz-msg p { margin: 0 0 .6em; }
.atsiz-msg p:last-child { margin-bottom: 0; }
.atsiz-msg--user { align-self: flex-end; background: var(--atsiz-user); white-space: pre-wrap; }
.atsiz-msg--assistant { align-self: flex-start; background: var(--atsiz-surface); border: 1px solid var(--atsiz-line); }
.atsiz-msg--error { align-self: center; color: var(--atsiz-accent); font-size: 14px; }

.atsiz-sources { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--atsiz-line); font-size: 13px; color: var(--atsiz-muted); }
.atsiz-sources a { color: var(--atsiz-accent); }

.atsiz-wait { display: flex; gap: 4px; }
.atsiz-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--atsiz-muted); animation: atsiz-blink 1.2s infinite; }
.atsiz-wait span:nth-child(2) { animation-delay: .2s; }
.atsiz-wait span:nth-child(3) { animation-delay: .4s; }
@keyframes atsiz-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.atsiz-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.atsiz-chip {
	background: var(--atsiz-surface);
	border: 1px solid var(--atsiz-line);
	color: var(--atsiz-ink);
	border-radius: 999px;
	padding: 4px 11px;
	font: inherit;
	font-size: 13.5px;
	cursor: pointer;
}
.atsiz-chip:hover { border-color: var(--atsiz-accent); }

.atsiz-note { margin: 0; padding: 0 14px 6px; font-size: 11.5px; color: var(--atsiz-muted); }

.atsiz-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--atsiz-line); background: var(--atsiz-surface); }
.atsiz-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--atsiz-line);
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	font-size: 15px;
	background: var(--atsiz-bg);
	color: var(--atsiz-ink);
}
.atsiz-send {
	background: var(--atsiz-accent);
	color: var(--atsiz-accent-ink);
	border: 0;
	border-radius: 8px;
	padding: 0 18px;
	font: inherit;
	font-weight: bold;
	cursor: pointer;
}
.atsiz-send:disabled { opacity: .5; cursor: wait; }

/* Köşe düğmesi */
.atsiz-sohbet--floating { position: fixed; right: 16px; bottom: 16px; z-index: 99999; }
.atsiz-toggle {
	background: var(--atsiz-accent);
	color: var(--atsiz-accent-ink);
	border: 0;
	border-radius: 999px;
	padding: 12px 20px;
	font: inherit;
	font-weight: bold;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	cursor: pointer;
}
.atsiz-sohbet--floating .atsiz-panel {
	display: none;
	position: absolute;
	right: 0;
	bottom: 60px;
	width: min(400px, calc(100vw - 32px));
	height: min(600px, calc(100vh - 100px));
	box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}
.atsiz-sohbet--floating.is-open .atsiz-panel { display: flex; }
.atsiz-sohbet--floating.is-open .atsiz-toggle { display: none; }
.atsiz-sohbet--floating.is-open .atsiz-panel { bottom: 0; }

/* Tanışma formu */
.atsiz-intro { display: none; flex: 1; overflow-y: auto; padding: 14px; flex-direction: column; gap: 10px; }
.atsiz-panel.is-intro .atsiz-intro { display: flex; }
.atsiz-panel.is-intro .atsiz-log,
.atsiz-panel.is-intro .atsiz-chips,
.atsiz-panel.is-intro .atsiz-who,
.atsiz-panel.is-intro .atsiz-form { display: none; }
.atsiz-intro-lead { margin: 0; font-weight: bold; }
.atsiz-field { display: flex; flex-direction: column; gap: 3px; }
.atsiz-field label { font-size: 14px; }
.atsiz-hint { color: var(--atsiz-muted); font-size: 12.5px; }
.atsiz-field input, .atsiz-field textarea {
	border: 1px solid var(--atsiz-line);
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	font-size: 15px;
	background: var(--atsiz-surface);
	color: var(--atsiz-ink);
	width: 100%;
	resize: vertical;
}
.atsiz-consent { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--atsiz-muted); }
.atsiz-consent input { margin-top: 4px; flex: none; }
.atsiz-consent a { color: var(--atsiz-accent); }
.atsiz-error { margin: 0; min-height: 1em; color: var(--atsiz-accent); font-size: 13.5px; }
.atsiz-error:empty { display: none; }
.atsiz-start { align-self: flex-start; padding: 10px 18px; }

.atsiz-who { margin: 0; padding: 0 14px 2px; font-size: 12.5px; color: var(--atsiz-muted); }
.atsiz-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--atsiz-accent); text-decoration: underline; cursor: pointer; }
.atsiz-reset[hidden] { display: none; }

/* Form panele sığmadığında öğeler ezilmesin; "Sohbete başla" düğmesi kaydırmadan hep görünsün. */
.atsiz-intro > * { flex-shrink: 0; }
.atsiz-intro { padding-bottom: 0; }
.atsiz-panel.is-intro > .atsiz-note { display: none; }
.atsiz-start-bar {
	position: sticky;
	bottom: 0;
	margin: 0 -14px;
	padding: 10px 14px 12px;
	background: var(--atsiz-bg);
	border-top: 1px solid var(--atsiz-line);
}
.atsiz-start-bar .atsiz-note { padding: 8px 0 0; }
.atsiz-start-bar .atsiz-consent { margin-bottom: 8px; }
.atsiz-start-bar .atsiz-error { margin: 0 0 8px; }
/* Temaların metin kutularına verdiği sabit yükseklikleri geçersiz kıl. */
.atsiz-sohbet .atsiz-field textarea { height: auto; min-height: 0; }
.atsiz-sohbet .atsiz-field input { height: auto; min-height: 0; line-height: 1.4; }

/* "Atsız'a Sorulan Sorular" sayfası (temanın yazı tipini kullanır) */
.atsiz-qa { --atsiz-qa-accent: #8b1e1e; --atsiz-qa-line: rgba(127, 127, 127, .3); --atsiz-qa-muted: rgba(127, 127, 127, 1); }
.atsiz-qa-note { font-size: .85em; font-style: italic; color: var(--atsiz-qa-muted); }
.atsiz-qa-item { padding: 1.4em 0; border-bottom: 1px solid var(--atsiz-qa-line); }
.atsiz-qa-q { margin: 0 0 .7em; font-size: 1.15em; line-height: 1.4; }
.atsiz-qa-q span, .atsiz-qa-label {
	display: block;
	font-size: .7em;
	font-weight: bold;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--atsiz-qa-accent);
	margin-bottom: .3em;
}
.atsiz-qa-a { padding-left: 1em; border-left: 3px solid var(--atsiz-qa-accent); }
.atsiz-qa-a .atsiz-qa-label { font-size: .75em; }
.atsiz-qa-sources, .atsiz-qa-meta { font-size: .85em; color: var(--atsiz-qa-muted); margin: .7em 0 0; }
.atsiz-qa-sources a, .atsiz-qa-meta a { color: var(--atsiz-qa-accent); }
.atsiz-qa-pages { margin-top: 1.5em; display: flex; gap: .6em; flex-wrap: wrap; }
@media (prefers-color-scheme: dark) { .atsiz-qa { --atsiz-qa-accent: #d0605a; } }

/* Cevap yazılırken */
.atsiz-wait { align-items: center; }
.atsiz-wait em { font-size: 13px; color: var(--atsiz-muted); margin-right: 4px; }
.atsiz-msg.is-typing { cursor: pointer; }
.atsiz-caret {
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	vertical-align: -0.15em;
	background: var(--atsiz-accent);
	animation: atsiz-caret 1s steps(2, start) infinite;
}
@keyframes atsiz-caret { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .atsiz-caret { animation: none; } }

/* Geçmiş listesi */
.atsiz-hist { display: none; flex: 1; overflow-y: auto; padding: 14px; flex-direction: column; gap: 6px; }
.atsiz-panel.is-history .atsiz-hist { display: flex; }
.atsiz-panel.is-history .atsiz-log,
.atsiz-panel.is-history .atsiz-chips,
.atsiz-panel.is-history .atsiz-who,
.atsiz-panel.is-history > .atsiz-note,
.atsiz-panel.is-history .atsiz-form { display: none; }
.atsiz-hist > * { flex-shrink: 0; }
.atsiz-hist-lead { margin: 0 0 4px; font-weight: bold; }
.atsiz-hist-empty { margin: 0; color: var(--atsiz-muted); font-size: 14px; }
.atsiz-hist-row { display: flex; align-items: stretch; gap: 4px; }
.atsiz-hist-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	text-align: left;
	background: var(--atsiz-surface);
	border: 1px solid var(--atsiz-line);
	border-radius: 8px;
	padding: 8px 11px;
	font: inherit;
	color: var(--atsiz-ink);
	cursor: pointer;
	min-width: 0;
}
.atsiz-hist-item:hover { border-color: var(--atsiz-accent); }
.atsiz-hist-row.is-current .atsiz-hist-item { border-color: var(--atsiz-accent); }
.atsiz-hist-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atsiz-hist-date { font-size: 12px; color: var(--atsiz-muted); }
.atsiz-hist-del {
	background: none;
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--atsiz-muted);
	font-size: 18px;
	padding: 0 8px;
	cursor: pointer;
}
.atsiz-hist-del:hover { color: var(--atsiz-accent); border-color: var(--atsiz-line); }
.atsiz-histbtn[hidden] { display: none; }
.atsiz-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.atsiz-head button { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 420px) { .atsiz-head { gap: 5px; padding: 10px; } .atsiz-head button { padding: 2px 6px; font-size: 12px; } }
.atsiz-sources-line + .atsiz-sources-line { margin-top: 4px; }

/* Bilgi simgesi ve açıklama kutusu (uyarı metni) */
.atsiz-head { position: relative; }
.atsiz-head .atsiz-info {
	order: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	opacity: .85;
	cursor: help;
	margin-right: auto;
}
.atsiz-head .atsiz-info:hover, .atsiz-head .atsiz-info:focus-visible { opacity: 1; background: rgba(255, 255, 255, .15); }
.atsiz-head .atsiz-info[hidden] { display: none; }
.atsiz-head .atsiz-title { flex: 0 1 auto; }
.atsiz-tip {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 10px;
	right: 10px;
	z-index: 5;
	padding: 10px 12px;
	border: 1px solid var(--atsiz-line);
	border-radius: 8px;
	background: var(--atsiz-surface);
	color: var(--atsiz-ink);
	font-size: 13px;
	font-weight: normal;
	line-height: 1.5;
	letter-spacing: 0;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.atsiz-head.tip-open .atsiz-tip,
.atsiz-info:hover ~ .atsiz-tip,
.atsiz-info:focus-visible ~ .atsiz-tip { display: block; }
@media (hover: none) { .atsiz-info:hover ~ .atsiz-tip { display: none; } .atsiz-head.tip-open .atsiz-tip { display: block; } }
.atsiz-qa-asker { margin: -.3em 0 .8em; font-size: .9em; font-style: italic; color: var(--atsiz-qa-muted); }
.atsiz-qa-back { margin: 0 0 1em; }
.atsiz-qa-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: .8em; font-size: .85em; }
.atsiz-qa-share span { color: var(--atsiz-qa-muted); }
.atsiz-qa-share a, .atsiz-qa-copy {
	padding: 3px 10px;
	border: 1px solid var(--atsiz-qa-line);
	border-radius: 999px;
	color: inherit;
	background: transparent;
	text-decoration: none;
	font: inherit;
	cursor: pointer;
}
.atsiz-qa-share a:hover, .atsiz-qa-copy:hover { border-color: var(--atsiz-qa-accent); color: var(--atsiz-qa-accent); }
