.bmg-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0; }
.bmg-brand-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.bmg-brand-actions .bmg-logout {
  min-height: 44px; padding: .5rem 1rem; border: 1px solid #e3c58b; border-radius: 8px;
  color: #141008; background: #e3c58b; font-size: 1rem; font-weight: 700;
}
.bmg-brand-actions .bmg-logout:hover { color: #141008; background: #f0d7a1; border-color: #f0d7a1; }
.bmg-brand-actions .bmg-logout:focus-visible { outline: 2px solid #f8e0ad; outline-offset: 3px; }
.bmg-navigation a, .bmg-preview a, .bmg-section a { color: #e3c58b; }
.bmg-section h2 { font: 1.45rem Georgia, serif; margin: 0 0 10px; }
.bmg-item { border: 1px solid #394957; border-radius: 10px; background: #101923; padding: 11px 13px; margin-bottom: 8px; }
.bmg-item p { color: #a4b3c4; font-size: .79rem; margin: 5px 0; }
.bmg-preview iframe { width: 100%; height: 58vh; margin-top: 12px; border: 1px solid #394957; border-radius: 8px; }
.bmg-preview a { margin-right: 12px; }
.bmg-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; justify-content: space-between; }
.bmg-invoice-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.bmg-invoices-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; margin-bottom: .65rem; }
.bmg-invoices-heading h2 { margin: 0; }
.bmg-search-field { width: 100%; min-width: 0; padding: .5rem .65rem; border: 1px solid #394957; border-radius: 7px; color: inherit; background: #101923; font: inherit; font-size: .875rem; }
.bmg-search-field::placeholder { color: #a4b3c4; }
@media (max-width: 1400px) {
  .bmg-invoices-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .bmg-search-field { grid-column: 1 / -1; grid-row: 2; }
}
.bmg-hourglass:not([hidden]) {
  display: inline-block; position: relative; width: 18px; height: 23px;
  margin-right: .4rem; vertical-align: middle; border-block: 2px solid #e3c58b;
  border-radius: 2px; animation: bmg-hourglass-turn 3.2s ease-in-out infinite;
}
.bmg-hourglass-glass {
  position: absolute; inset: 0 1px; background: #e3c58b;
  clip-path: polygon(0 0, 100% 0, 60% 48%, 60% 52%, 100% 100%, 0 100%, 40% 52%, 40% 48%);
}
.bmg-hourglass-glass::before {
  content: ""; position: absolute; inset: 0 2px; background: #18212b;
  clip-path: inherit;
}
.bmg-sand-top, .bmg-sand-bottom {
  position: absolute; left: 2px; right: 2px; height: 45%;
  background: #f2c56a; transform-origin: center bottom;
}
.bmg-sand-top { top: 3%; clip-path: polygon(0 0, 100% 0, 50% 100%); animation: bmg-sand-drain 3.2s linear infinite; }
.bmg-sand-bottom { bottom: 1px; clip-path: polygon(50% 28%, 100% 100%, 0 100%); animation: bmg-sand-fill 3.2s linear infinite; }
.bmg-sand-stream {
  position: absolute; top: 42%; bottom: 12%; left: calc(50% - .5px); width: 1px;
  background: repeating-linear-gradient(#f2c56a 0 1px, transparent 1px 3px);
  animation: bmg-sand-fall .25s linear infinite, bmg-sand-flow 3.2s linear infinite;
}
@keyframes bmg-hourglass-turn { 0%, 78% { transform: rotate(0); } 94%, 100% { transform: rotate(180deg); } }
@keyframes bmg-sand-drain { 0%, 5% { transform: scaleY(1); } 75%, 100% { transform: scaleY(0); } }
@keyframes bmg-sand-fill { 0%, 5% { transform: scaleY(.1); } 75%, 100% { transform: scaleY(1); } }
@keyframes bmg-sand-fall { to { background-position: 0 3px; } }
@keyframes bmg-sand-flow { 0%, 75% { opacity: 1; } 78%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bmg-hourglass:not([hidden]), .bmg-hourglass-glass > span { animation: none; }
  .bmg-sand-top { transform: scaleY(.65); }
  .bmg-sand-bottom { transform: scaleY(.55); }
}
.bmg-invoice-list { max-height: min(54dvh, 32rem); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: #796746 #101923; }
.bmg-invoice-list .bmg-item:last-child { margin-bottom: 0; }
.bmg-invoice-list a { overflow-wrap: anywhere; }
.bmg-invoice-delete { float: right; margin-left: .5rem; color: #f4aaaa; }
.bmg-delete-dialog { width: min(94vw, 25rem); color: #e7edf5; border: 1px solid #394957; border-radius: 12px; background: #101923; padding: 1.15rem; }
.bmg-delete-dialog::backdrop { background: rgba(3, 8, 15, .76); }
.bmg-delete-dialog p { overflow-wrap: anywhere; }
.bmg-delete-dialog label { display: block; font-size: .83rem; }
.bmg-delete-dialog input { display: block; width: 100%; padding: .5rem .65rem; margin: .45rem 0 .85rem; border: 1px solid #394957; border-radius: 7px; color: inherit; background: #080f18; font: inherit; }
.bmg-delete-dialog .bmg-invoice-toolbar { justify-content: flex-end; }
#bmg-delete-confirm, #bmg-delete-error { color: #f4aaaa; }
.bmg-server-card { --state-color: #a8b4c3; }
.bmg-server-card[data-state="online"] { --state-color: #55e6a3; }
.bmg-server-card[data-state^="sleep"], .bmg-server-card[data-state="wake_pending"], .bmg-server-card[data-state="degraded"] { --state-color: #ffd36f; }
.bmg-server-card[data-state^="off"] { --state-color: #ff7b7b; }
.bmg-server-head { display: flex; align-items: center; gap: 11px; }
.bmg-server-head .profile-source { margin-left: auto; text-align: center; }
.bmg-server-card .status { margin-left: 0; }
.bmg-server-card > p { margin-left: 41px; }
.bmg-preview h3 { margin: 0 0 .7rem; font-size: .95rem; overflow-wrap: anywhere; }
.bmg-preview-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.bmg-order-message { color: #e3c58b; font-size: .78rem; min-height: 1.1em; margin: .25rem 0 .6rem; }
.bmg-order-controls { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.bmg-order-controls button { min-height: 30px; padding: 4px 8px; }
.bmg-item[draggable="true"] { cursor: grab; }
.bmg-item.bmg-order-target { outline: 1px solid #e3c58b; }
.context .bmg-credit { display: inline-flex; align-items: center; gap: .45em; color: #fff; padding: 0 0 0 .4em; text-transform: none; letter-spacing: .06em; white-space: nowrap; }
.context .bmg-credit-dot { width: 4px; height: 4px; flex: 0 0 4px; padding: 0; border-radius: 50%; background: #e9c36d; }
