/* Sayfaya özgü stiller: araç çubuğu, gruplar, giriş sihirbazı, post oluşturucu, Telegram önizlemesi. */

.page-intro {
  max-width: 72ch;
  margin: calc(var(--s-3) * -1) 0 var(--s-4);
}

.pad {
  padding: var(--s-3) var(--s-4);
}

.pad-top {
  margin-top: var(--s-3);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.bullets {
  list-style: disc;
  padding-left: 1.3em;
  display: grid;
  gap: var(--s-1);
}

.push-end {
  margin-left: auto;
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Araç çubuğu (süzgeçler) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
}

.toolbar .input {
  width: auto;
  min-width: 150px;
  max-width: 100%;
}

.toolbar-label {
  font-size: var(--fs-s);
  font-weight: 600;
  color: var(--muted);
}

/* Sekmeler (bağlantı olarak) */
a.tab {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tab[aria-current="page"] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* Gruplar */
.inline-copy {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  max-width: 100%;
}

.inline-copy a,
.inline-copy .mono {
  overflow-wrap: anywhere;
}

.detail {
  display: grid;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line-strong);
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
}

.detail .panel-head h3 {
  font-size: var(--fs-m);
}

/* <fieldset> içinde display:grid güvenilir değil (içerik daralıyor): blok düzen + bitişik kardeş aralığı kullanılır. */
.fieldset,
.step {
  display: block;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: var(--s-5);
  background: var(--surface);
}

.fieldset > :not(legend) ~ :not(legend),
.step > :not(legend) ~ :not(legend) {
  margin-top: var(--s-3);
}

.fieldset > legend + *,
.step > legend + * {
  margin-top: 0;
}

.fieldset {
  background: var(--surface-2);
  border-radius: var(--r-m);
  padding: var(--s-4);
}

.fieldset legend,
.step legend {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-2);
  font-weight: 650;
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.rights-grid {
  display: grid;
  gap: var(--s-2) var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* Giriş sihirbazı */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-1);
}

.wizard-steps li {
  padding-top: var(--s-2);
  border-top: 4px solid var(--line-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}

.wizard-steps li[data-state="done"] {
  border-top-color: var(--ok);
}

.wizard-steps li[data-state="current"] {
  border-top-color: var(--btn);
  color: var(--ink);
}

.wizard-progress {
  width: 100%;
  height: 8px;
  accent-color: var(--btn);
}

/* Post listesi */
.post-text {
  color: var(--ink-2);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* Post oluşturucu */
.composer {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: minmax(0, 1fr);
}

.composer-main {
  display: grid;
  gap: var(--s-4);
  min-width: 0;
}

.composer-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.composer-actions .row {
  justify-content: flex-end;
}

.issues:focus {
  outline: none;
}

.issues ul {
  list-style: disc;
  padding-left: 1.2em;
}

@media (min-width: 1100px) {
  .composer {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "main side" "actions side";
    align-items: start;
  }

  .composer-main {
    grid-area: main;
  }

  .composer-preview {
    grid-area: side;
    position: sticky;
    top: var(--s-5);
  }

  .composer-actions {
    grid-area: actions;
  }
}

.preview-title {
  margin-bottom: var(--s-2);
  font-size: var(--fs-m);
}

.mode-cards {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.mode-card {
  position: relative;
  display: grid;
  gap: var(--s-1);
  align-content: start;
  padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.mode-card input {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--btn);
}

.mode-card:hover {
  border-color: var(--brand);
}

.mode-card:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.mode-card[data-checked="true"] {
  border-color: var(--btn);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--btn), var(--shadow-sm);
}

.mode-card[data-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}

.mode-title {
  font-weight: 650;
  padding-right: 26px;
}

.mode-desc,
.mode-detail {
  font-size: var(--fs-s);
  color: var(--ink-2);
}

.mode-detail {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.mode-reason {
  font-size: var(--fs-xs);
  color: var(--err);
  font-weight: 600;
}

.mode-reason:empty {
  display: none;
}

.md-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.md-tool {
  min-width: 40px;
}

.md-b { font-weight: 800; }
.md-i { font-style: italic; }
.md-u { text-decoration: underline; }
.md-s { text-decoration: line-through; }

.counter-field {
  align-content: end;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}

.media-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
}

.media-thumb {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.media-file {
  width: 112px;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: var(--s-1);
  padding: var(--s-2);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

/* Buton oluşturucu */
.kb-row {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface-2);
}

.kb-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

.kb-row-head h4 {
  margin: 0;
  font-size: var(--fs-m);
}

.kb-cells {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.kb-cell {
  display: grid;
  gap: var(--s-3);
  align-content: start;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}

.kb-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[aria-disabled="true"].btn:not(.is-busy) {
  opacity: 0.55;
}

/* Telegram benzeri önizleme */
.tg {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background: var(--surface);
}

.tg-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
}

.tg-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  font-weight: 700;
}

.tg-head-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.tg-title {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-sub {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.tg-body {
  display: grid;
  gap: 4px;
  align-content: end;
  min-height: 220px;
  padding: var(--s-4) var(--s-3);
  background-color: var(--chat-bg);
  background-image: radial-gradient(circle at 25% 30%, color-mix(in srgb, var(--chat-ink) 7%, transparent) 0 2px, transparent 3px), radial-gradient(circle at 75% 70%, color-mix(in srgb, var(--chat-ink) 6%, transparent) 0 1.5px, transparent 2.5px);
  background-size: 34px 34px, 46px 46px;
}

.tg-msg {
  justify-self: start;
  width: fit-content;
  max-width: min(100%, 360px);
  padding: 7px 11px 5px;
  border-radius: 14px 14px 14px 4px;
  background: var(--chat-bubble);
  color: var(--chat-ink);
}

.tg-sender {
  font-size: var(--fs-s);
  font-weight: 650;
  color: var(--chat-accent);
  overflow-wrap: anywhere;
}

.tg-sender[data-bot="true"]::after {
  content: "bot";
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--chat-btn);
  color: var(--chat-meta);
  font-size: 0.68rem;
  font-weight: 600;
}

.tg-media {
  margin: 4px -4px 4px;
}

.tg-media img,
.tg-media video {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 9px;
}

.tg-doc {
  padding: var(--s-2) var(--s-3);
  border-radius: 9px;
  background: var(--chat-btn);
  font-size: var(--fs-s);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tg-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.4;
}

.tg-text.is-empty {
  color: var(--chat-meta);
  font-style: italic;
}

.tg-text code,
.tg-text pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--chat-btn);
  border-radius: 4px;
}

.tg-text code {
  padding: 0 4px;
}

.tg-text pre {
  margin: 4px 0;
  padding: 6px 8px;
  white-space: pre-wrap;
}

.tg-text blockquote {
  margin: 4px 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--chat-accent);
}

.tg-link {
  color: var(--info);
  text-decoration: underline;
}

.tg-via {
  font-size: var(--fs-xs);
  color: var(--chat-meta);
}

.tg-meta {
  text-align: right;
  font-size: 0.7rem;
  color: var(--chat-meta);
}

.tg-kb {
  display: grid;
  gap: 3px;
  justify-self: start;
  width: min(100%, 360px);
}

.tg-kb-row {
  display: flex;
  gap: 3px;
}

.tg-kb-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--chat-bubble) 78%, var(--chat-bg));
  color: var(--chat-ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  overflow-wrap: anywhere;
  border: 1px solid var(--chat-btn);
}

@media (max-width: 559px) {
  .composer-actions .row .btn {
    flex: 1 1 auto;
  }
}
