.rich-toolbar { display: block;
  padding: 6px 8px; background: var(--surface); border-radius: 12px;
  position: sticky; top: 0; z-index: 3; }
.rich-basic { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: thin; }
.rich-basic > * { flex-shrink: 0; }
.rich-menus { display: flex; align-items: center; gap: 8px; position: relative;
  padding-top: 4px; margin-top: 4px; }
.rich-mode-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.compose .rich-mode-row label { display: flex; align-items: center; gap: 10px;
  margin: 0; font-size: 12px; color: var(--muted); }
.compose .rich-mode-row select { width: auto; margin: 0; padding: 6px 10px; }
.html-panel { background: var(--surface); padding: 18px; border-radius: 12px; }
.html-help, .html-status { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.compose textarea.html-source { width: 100%; min-height: 430px; resize: vertical;
  font: 13px/1.7 Consolas, monospace; tab-size: 2; border: 0; padding: 12px;
  background: var(--soft); white-space: pre; }
.html-source[aria-invalid="true"] { outline: 2px solid var(--accent); }
.html-status { margin-top: 12px; }
.html-panel[hidden], .rich-toolbar[hidden] { display: none; }
@media (max-width: 1000px) {
  .compose textarea.html-source { min-height: 300px; }
}
:root {
  --work-blue: #1556b3; --work-teal: #087168; --work-rose: #ad3054; --work-amber: #855400;
  --work-highlight-yellow: #fff0a6; --work-highlight-blue: #dceaff; --work-highlight-mint: #c6f1e3;
}
:root[data-theme="dark"] {
  --work-blue: #92baff; --work-teal: #75dbc9; --work-rose: #ffabc2; --work-amber: #f1c66f;
  --work-highlight-yellow: #51441c; --work-highlight-blue: #243d65; --work-highlight-mint: #1c4942;
}
.rich-advanced { min-width: 0; }
.compose .rich-advanced > summary { margin: 0; padding: 8px; font-size: 12px;
  font-weight: 500; list-style: none; border-radius: 6px; min-height: 36px;
  display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.rich-advanced > summary::-webkit-details-marker { display: none; }
.rich-advanced > summary::after { content: ''; width: 5px; height: 5px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg); }
.rich-advanced[open] > summary { background: var(--tint); color: var(--accent); }
.rich-advanced > summary:hover { background: var(--hover); }
.rich-popover { position: absolute; left: 0; right: 0; top: calc(100% + 10px);
  background: var(--surface); padding: 16px; border-radius: 12px;
  box-shadow: 0 12px 36px #0003; max-height: min(55dvh, 420px); overflow-y: auto;
  overscroll-behavior: contain; }
.rich-controls { display: flex; flex-wrap: wrap; gap: 12px; padding: 0;
  align-items: end; }
.compose .rich-controls label { margin: 0; font-size: 11px; min-width: 100px; }
.rich-controls select { display: block; margin-top: 4px; max-width: 180px; }
.rich-contrast { color: var(--muted); font-size: 12px; padding: 0 8px; }
.rich-controls input[type="number"] { width: 70px; padding: 6px; margin: 4px 0 0; }
.rich-table-context { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 0; }
.rich-table-context[hidden] { display: none; }
.rich-toolbar .rich-table-context button, .rich-toolbar .rich-controls button {
  width: auto; font-size: 12px; flex: 0 0 auto;
}
.rich-table-note { color: var(--muted); font-size: 11px; margin: 5px 8px; }
.rich-table-note[hidden] { display: none; }
.rich-host .tableWrapper, .table-scroll { max-width: 100%; overflow-x: auto; margin: 18px 0;
  border-radius: 8px; }
.rich-host table, .table-scroll table { border-collapse: collapse; table-layout: fixed;
  min-width: 100%; }
.rich-host td, .rich-host th, .table-scroll td, .table-scroll th {
  border: 1px solid var(--line); min-width: 90px; padding: 10px; vertical-align: top;
  position: relative; overflow-wrap: anywhere;
}
.rich-host th, .table-scroll th { background: var(--tint); font-weight: 600; }
.rich-host .selectedCell { background: var(--tint); }
.rich-host td p, .rich-host th p, .table-scroll td p, .table-scroll th p { margin: 0; }
.rich-toolbar button { width: 36px; min-height: 36px; padding: 6px; border-radius: 7px;
  white-space: nowrap; }
.rich-toolbar button[aria-pressed="true"] { background: var(--tint); }
.rich-toolbar button:disabled { opacity: .35; cursor: default; }
.rich-toolbar select { width: auto; max-width: 130px; margin: 0; padding: 6px; }
.rich-host .tiptap { min-height: 430px; padding: 24px; line-height: 1.8;
  margin-top: 14px; background: var(--surface); border-radius: 12px; outline: none;
  overflow-wrap: anywhere; }
.rich-host .tiptap:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.rich-host .tiptap > p:only-child:has(> br:only-child)::before {
  content: 'Mulai menulis di sini…'; color: var(--muted); opacity: .75;
  float: left; height: 0; pointer-events: none; }
.rich-host p { margin: 0 0 14px; }
.rich-host h2, .article-body h2 { font-size: 27px; margin: 22px 0 12px; }
.rich-host h3, .article-body h3 { margin: 18px 0 10px; }
.rich-host a, .article-body a { color: var(--accent); text-decoration: underline; }
.rich-host blockquote, .article-body blockquote { margin: 18px 0; padding: 4px 18px;
  border-left: 3px solid var(--accent); color: var(--muted); }
.rich-host code, .article-body code { font-family: monospace; background: var(--tint);
  border-radius: 4px; padding: 2px 4px; }
.rich-host figure { margin: 20px 0; }
.rich-host figure img { max-width: 100%; height: auto; border-radius: 10px; }
.rich-host figcaption { color: var(--muted); font-size: 12px; }
.compose textarea[hidden], .compose label[hidden] { display: none; }
@media(max-width:540px) {
  .rich-host .tiptap { min-height: 300px; padding: 18px; }
  .rich-menus { gap: 0; justify-content: space-between; }
  .compose .rich-advanced > summary { padding: 8px 4px; font-size: 11px; gap: 5px; }
  .rich-popover { padding: 12px; }
}
