/* Editor (edit mode) + read-only article (view mode) share typography. */

#editor {
  min-height: 50vh;
  outline: none;
}
#editor:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
}

#editor, #pageView { line-height: 1.6; }
#editor h1, #pageView h1 { font-size: 1.875rem; font-weight: 700; margin: 1rem 0 0.5rem; }
#editor h2, #pageView h2 { font-size: 1.5rem;  font-weight: 700; margin: 0.9rem 0 0.4rem; }
#editor h3, #pageView h3 { font-size: 1.25rem; font-weight: 700; margin: 0.8rem 0 0.4rem; }
#editor p,  #pageView p  { margin: 0.4rem 0; }
#editor ul, #pageView ul { list-style: disc; padding-left: 1.5rem; margin: 0.4rem 0; }
#editor ol, #pageView ol { list-style: decimal; padding-left: 1.5rem; margin: 0.4rem 0; }
#editor blockquote, #pageView blockquote {
  border-left: 4px solid #c7d2fe;
  background: #eef2ff;
  padding: 0.5rem 1rem;
  margin: 0.6rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}
#editor pre, #pageView pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 0.6rem 0;
}
#editor code, #pageView code {
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
#editor table, #pageView table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.6rem 0;
}
#editor th, #editor td, #pageView th, #pageView td {
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.6rem;
  text-align: left;
}
#editor th, #pageView th { background: #f1f5f9; font-weight: 600; }
#editor img, #pageView img { max-width: 100%; border-radius: 0.5rem; margin: 0.4rem 0; }
#editor a, #pageView a { color: #4f46e5; text-decoration: underline; }

.diff-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-add    { background: #dcfce7; }
.diff-remove { background: #fee2e2; }
.diff-equal  { color: #475569; }

.kw {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin: 0.1rem;
}

.tree-item { cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 0.375rem; display: flex; align-items: center; gap: 0.25rem; }
.tree-item:hover { background: #f1f5f9; }
.tree-item.active { background: #e0e7ff; color: #3730a3; font-weight: 600; }
.tree-children { padding-left: 1rem; }

/* ---- Rich text (ticket dialog) ---- */
.rt { border: 1px solid #cbd5e1; border-radius: .6rem; background: #fff; overflow: hidden; margin-top: .25rem; }
.rt:focus-within { border-color: #6366f1; box-shadow: 0 0 0 2px #e0e7ff; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .25rem .4rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.rt-btn { min-width: 1.9rem; padding: .15rem .45rem; font-size: .8rem; border-radius: .35rem; color: #475569; }
.rt-btn:hover { background: #e0e7ff; color: #3730a3; }
.rt-hint { margin-left: auto; font-size: .7rem; color: #94a3b8; }
.rt-body { min-height: 6rem; max-height: 16rem; overflow: auto; padding: .6rem .8rem; outline: none; font-size: .9rem; line-height: 1.55; }
.rt-body:empty:before { content: attr(data-placeholder); color: #9ca3af; }
.rich p { margin: .35rem 0; }
.rich h3 { font-size: 1rem; font-weight: 700; margin: .7rem 0 .3rem; }
.rich ul { list-style: disc; padding-left: 1.4rem; margin: .35rem 0; }
.rich ol { list-style: decimal; padding-left: 1.4rem; margin: .35rem 0; }
.rich li { margin: .15rem 0; }
.rich a { color: #4f46e5; text-decoration: underline; }
.rich code { background: #eef2ff; color: #3730a3; padding: .05rem .35rem; border-radius: .3rem; font-size: .85em; }
.rich blockquote { border-left: 3px solid #c7d2fe; padding-left: .8rem; color: #475569; }

/* Ticket read view */
.tk-sec { margin-top: 1.25rem; }
.tk-sec h4 { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: #64748b; margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.tk-sec h4 .cnt { background: #e2e8f0; color: #475569; border-radius: 999px; padding: 0 .45rem; font-size: .7rem; letter-spacing: 0; }
.tk-steps { position: relative; list-style: none; padding: 0; margin: 0; }
.tk-steps li { position: relative; display: flex; gap: .75rem; padding-bottom: .85rem; font-size: .9rem; line-height: 1.5; }
.tk-steps li:not(:last-child)::before { content: ""; position: absolute; left: .8rem; top: 1.7rem; bottom: .1rem; width: 2px; background: #c7d2fe; }
.tk-steps .n { flex: none; width: 1.65rem; height: 1.65rem; border-radius: 999px; background: #4f46e5; color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tk-steps .t { padding-top: .12rem; min-width: 0; overflow-wrap: anywhere; }
.tk-ac { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.tk-ac li { display: flex; gap: .6rem; align-items: flex-start; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: .55rem; padding: .45rem .7rem; font-size: .88rem; line-height: 1.45; }
.tk-ac li::before { content: "✓"; flex: none; color: #16a34a; font-weight: 700; }
.tk-chip { font-size: .72rem; padding: .1rem .55rem; border-radius: 999px; background: #f1f5f9; color: #475569; }
