[x-cloak] { display: none !important; }

html, body { height: 100%; }

/* Hide the native "clear" button on search inputs; the portal renders its own. */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Slim scrollbars like the reference portal */
.sidebar-scroll::-webkit-scrollbar { width: 0; }

/* Tooltip (tippy.js look-alike) */
.astra-tip {
  position: fixed; z-index: 9999; max-width: 320px; pointer-events: none;
  padding: 5px 9px; border-radius: 4px; background: #a3a3a3; color: #fff;
  font-size: 14px; line-height: 1.4; white-space: pre-line; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.astra-tip::after {
  content: ''; position: absolute; left: var(--arrow-left, 50%); bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom: 0; border-top-color: #a3a3a3;
}
.astra-tip.below::after { bottom: auto; top: -6px; border-top: 0; border-bottom: 6px solid #a3a3a3; }

/* Rich text editor (Trix look-alike) */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rte-group { display: flex; border: 1px solid #bbb; border-radius: 3px; overflow: hidden; }
.rte-group button { width: 32px; height: 28px; display: flex; align-items: center; justify-content: center; color: #4b5563; background: #fff; border-left: 1px solid #ddd; }
.rte-group button:first-child { border-left: 0; }
.rte-group button:hover { background: #f3f4f6; }
.rte-group button.active { background: #cbeefa; color: #1d4ed8; }
.rte-editor { min-height: 5em; max-height: 20em; overflow-y: auto; padding: .5rem .75rem; background: #fff; border: 1px solid #d1d5db; border-radius: .25rem; font-size: .875rem; line-height: 1.5; outline: none; }
.rte-editor:focus { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.rte-editor:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.rte-editor ul { list-style: disc; padding-left: 1.5rem; }
.rte-editor ol { list-style: decimal; padding-left: 1.5rem; }
.rte-editor blockquote { border-left: 3px solid #ccc; padding-left: .6rem; color: #555; }
.rte-editor h1 { font-size: 1.2em; font-weight: 600; }
.rte-editor pre { background: #eee; padding: .5em; font-family: monospace; font-size: .9em; }
.rte-editor a, .note-body a { color: #2563eb; text-decoration: underline; }
.note-body ul { list-style: disc; padding-left: 1.25rem; }
.note-body ol { list-style: decimal; padding-left: 1.25rem; }

/* SMS bubbles */
.bubble-out { position: relative; }
.bubble-out::before { content: ''; position: absolute; bottom: 0; right: -8px; height: 20px; width: 17px; background: #3b82f6; border-bottom-left-radius: 15px; z-index: 0; }
.bubble-out::after { content: ''; position: absolute; bottom: 0; right: -10px; width: 10px; height: 20px; background: #fff; border-bottom-left-radius: 10px; z-index: 1; }
.bubble-in { position: relative; }
.bubble-in::before { content: ''; position: absolute; bottom: 0; left: -8px; height: 20px; width: 17px; background: #e5e7eb; border-bottom-right-radius: 15px; z-index: 0; }
.bubble-in::after { content: ''; position: absolute; bottom: 0; left: -10px; width: 10px; height: 20px; background: #fff; border-bottom-right-radius: 10px; z-index: 1; }

/* Multi-select chips (select2 look-alike) */
.chip { display: inline-flex; align-items: center; gap: 4px; margin: 3px 4px 3px 0; padding: 0 6px; border: 1px solid #aaa; border-radius: 4px; background: #e4e4e4; font-size: 13px; line-height: 20px; color: #333; }
.chip button { color: #999; font-weight: 700; }
.chip button:hover { color: #333; }
