.advanced-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.advanced-toolbar button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
}

.advanced-toolbar button:hover,
.advanced-toolbar button:focus-visible {
  color: var(--accent, #fa641e);
  background: #fff;
  border-color: #dbe2eb;
}

.editor-shell,
.reply-form,
.chat-composer,
.chat-message-editor {
  position: relative;
}

.editor-media-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
}

.editor-shell.is-dragging,
.reply-form.is-dragging,
.chat-composer.is-dragging,
.chat-message-editor.is-dragging {
  outline: 2px dashed var(--accent, #fa641e);
  outline-offset: 3px;
}

.editor-shell.is-dragging::after,
.reply-form.is-dragging::after,
.chat-composer.is-dragging::after,
.chat-message-editor.is-dragging::after {
  content: "Görseli yüklemek için bırakın";
  position: absolute;
  inset: 8px;
  z-index: 8;
  display: grid;
  place-items: center;
  color: #b43c08;
  font-weight: 700;
  background: rgba(255, 247, 242, .95);
  border: 1px dashed #fa641e;
  border-radius: 10px;
  pointer-events: none;
}

.editor-media-status {
  display: block;
  min-height: 19px;
  margin: 6px 8px 0;
  color: #64748b;
  font-size: 12px;
}

.editor-media-status[data-state="loading"]::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid #d6dde8;
  border-top-color: var(--accent, #fa641e);
  border-radius: 50%;
  animation: editor-media-spin .7s linear infinite;
}

.editor-media-status[data-state="success"] { color: #087a46; }
.editor-media-status[data-state="error"] { color: #b42318; }
@keyframes editor-media-spin { to { transform: rotate(360deg); } }

.editor-emoji-picker {
  position: fixed;
  z-index: 1200;
  left: 12px;
  top: 12px;
  width: min(410px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 8px;
  color: #142238;
  background: #fff;
  border: 1px solid #dbe2eb;
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(15, 35, 61, .18);
}

.emoji-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 7px;
  border-bottom: 1px solid #e7ebf1;
}

.emoji-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 9px;
  color: #536176;
  font-size: 11px;
  font-weight: 650;
  background: #f4f6f9;
  border: 0;
  border-radius: 7px;
}

.emoji-tabs button.active {
  color: #fff;
  background: #193253;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  max-height: 194px;
  padding-top: 8px;
  overflow-y: auto;
}

.emoji-grid button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 36px;
  padding: 0;
  font-size: 21px;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.emoji-grid button:hover,
.emoji-grid button:focus-visible { background: #fff0e8; }

.post-image-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 12px 0;
}

.post-image {
  display: block;
  max-width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: #f2f4f7;
  border: 1px solid #dce2ea;
  border-radius: 10px;
}

.media-embed,
.media-link-card {
  width: min(720px, 100%);
  margin: 14px 0;
  overflow: hidden;
  color: #142238;
  background: #f7f9fc;
  border: 1px solid #d9e0e9;
  border-radius: 12px;
}

.media-embed.media-youtube {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #07101d;
}

.media-embed.media-youtube iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-play-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  background: #07101d;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.media-play-button > span:not(.media-provider-icon) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.media-play-button strong { font-size: 17px; }
.media-play-button small { color: #cbd5e1; font-size: 12px; }
.media-play-button > i { color: #fff; font-size: 34px; }

.media-provider-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: #fff;
  background: #172d4b;
  border-radius: 10px;
}

.media-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 13px 15px;
  color: inherit;
  text-decoration: none;
}

.media-link-card:hover { background: #f1f5f9; }
.media-youtube .media-provider-icon { background: #e62117; }
.media-link-card[data-provider="x"] .media-provider-icon { background: #111827; }
.media-link-card[data-provider="facebook"] .media-provider-icon { background: #1877f2; }
.media-link-card > span:not(.media-provider-icon) { min-width: 0; flex: 1; }
.media-link-card b,
.media-link-card small { display: block; }
.media-link-card small {
  margin-top: 4px;
  overflow: hidden;
  color: #66758a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-link-card > i:last-child { color: #7b8798; }
.media-source-link {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  color: #dbeafe;
  font-size: 11px;
  text-decoration: none;
}

.post-list,
.post-list.ordered { margin: 9px 0 9px 22px; }
.post-heading { margin: 14px 0 7px; font-size: 1.13em; }
.post-spoiler {
  margin: 11px 0;
  padding: 9px 12px;
  background: #f5f7fa;
  border: 1px solid #dce2ea;
  border-radius: 8px;
}
.post-spoiler summary { cursor: pointer; font-weight: 700; }
.post-spoiler > div { padding-top: 9px; }

.chat-bubble .post-image { max-height: 340px; }
.chat-bubble .media-embed { max-width: 460px; }

@media (max-width: 720px) {
  .advanced-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
  .advanced-toolbar button { flex-basis: 38px; }
  .emoji-grid { grid-template-columns: repeat(8, 1fr); }
  .post-image { max-height: 480px; }
  .media-link-card { padding: 11px 12px; }
}
