.mlh-frontend-wrap {
  max-width: 1100px;
  margin: 20px auto;
  padding: 16px;
  border: 1px solid #d0d8e0;
  border-radius: 10px;
  background: #ffffff;
}

.mlh-hub-header h2 {
  margin: 0 0 6px;
}

.mlh-hub-header p {
  margin: 0 0 12px;
  color: #475569;
}

.mlh-hub-search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mlh-hub-search-form input[type="search"] {
  flex: 1 1 320px;
  min-width: 220px;
}

.mlh-hub-search-form button,
.mlh-hub-search-form .mlh-clear-btn,
.mlh-hub-search-form .mlh-add-btn {
  border: 1px solid #334155;
  background: #0f172a;
  color: #ffffff;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

.mlh-hub-search-form .mlh-clear-btn {
  background: #ffffff;
  color: #0f172a;
}

.mlh-hub-search-form .mlh-add-btn {
  background: #166534;
  border-color: #166534;
}

.mlh-hub-table-wrap {
  overflow-x: auto;
}

.mlh-hub-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.mlh-hub-table th,
.mlh-hub-table td {
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

.mlh-row-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.mlh-inline-btn {
  border: 1px solid #1f2937;
  background: #ffffff;
  color: #1f2937;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.mlh-inline-btn:hover {
  background: #f1f5f9;
}

.mlh-hub-table th {
  background: #f8fafc;
  font-weight: 700;
}

.mlh-frontend-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.mlh-frontend-form label,
.mlh-frontend-form fieldset {
  display: block;
}

.mlh-frontend-form fieldset {
  border: 1px solid #d0d8e0;
  border-radius: 8px;
  padding: 10px;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mlh-frontend-form legend {
  font-weight: 700;
  padding: 0 4px;
}

.mlh-frontend-form input,
.mlh-frontend-form select,
.mlh-frontend-form textarea {
  width: 100%;
  margin-top: 4px;
}

.mlh-frontend-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  border-radius: 6px;
  padding: 9px 14px;
}

.mlh-form-guard {
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}

.mlh-quick-search {
  max-width: 760px;
  margin: 20px auto;
  padding: 16px;
  border: 1px solid #d0d8e0;
  border-radius: 10px;
  background: #ffffff;
}

.mlh-quick-search label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.mlh-quick-search input[type="search"] {
  width: 100%;
}

.mlh-quick-search-results {
  margin-top: 10px;
}

.mlh-result-item {
  border: 1px solid #d7dee7;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mlh-result-address {
  margin-top: 4px;
  color: #334155;
}

.mlh-result-meta {
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
}

.mlh-result-empty,
.mlh-result-loading {
  padding: 8px;
  color: #334155;
}

.mlh-quick-search-link {
  margin-top: 10px;
}

.mlh-reminder-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mlh-reminder-dialog {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  padding: 14px;
}

.mlh-reminder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mlh-reminder-head h3 {
  margin: 0;
}

.mlh-reminder-form {
  display: grid;
  gap: 10px;
}

.mlh-reminder-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.mlh-reminder-form input[type="text"],
.mlh-reminder-form input[type="number"],
.mlh-reminder-form input[type="datetime-local"],
.mlh-reminder-form select,
.mlh-reminder-form textarea {
  width: 100%;
}

.mlh-reminder-form select[multiple] {
  min-height: 92px;
}

.mlh-reminder-token-help {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mlh-reminder-token-help code {
  background: #f1f5f9;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
}

.mlh-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mlh-reminder-actions .mlh-inline-btn {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.mlh-reminder-message {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 20px;
  color: #334155;
}

.mlh-reminder-message.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.mlh-reminder-message.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.mlh-tenant-easy-mode {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 35%);
}

.mlh-easy-head h2 {
  margin: 0 0 6px;
}

.mlh-easy-head p {
  margin: 0 0 12px;
  color: #475569;
}

.mlh-easy-priority-card {
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  margin-bottom: 12px;
}

.mlh-priority-danger {
  border-color: #fecaca;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.mlh-priority-warn {
  border-color: #fed7aa;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.mlh-priority-ok {
  border-color: #bbf7d0;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.mlh-easy-priority-badge {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.mlh-badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.mlh-badge-warn {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

.mlh-badge-ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.mlh-badge-neutral {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}

.mlh-easy-priority-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.mlh-easy-priority-meta {
  margin: 0 0 6px;
  color: #334155;
}

.mlh-easy-priority-address {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.mlh-easy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mlh-easy-grid label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.mlh-easy-grid input,
.mlh-easy-grid select {
  width: 100%;
  min-height: 38px;
}

.mlh-easy-note-wrap {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-top: 10px;
}

.mlh-easy-note {
  width: 100%;
  min-height: 96px;
}

.mlh-easy-advanced {
  margin-top: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.mlh-easy-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: #334155;
}

.mlh-easy-grid-advanced {
  margin-top: 10px;
}

.mlh-easy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mlh-easy-actions .mlh-inline-btn {
  min-height: 42px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
}

.mlh-easy-send-now {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.mlh-easy-send-schedule {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.mlh-easy-send-chat {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
}

.mlh-easy-create-chat-link,
.mlh-easy-copy-chat-link {
  background: #ffffff;
  border-color: #7c3aed;
  color: #4c1d95;
}

.mlh-easy-close-chat {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.mlh-easy-mark-paid {
  background: #166534;
  border-color: #166534;
  color: #ffffff;
}

.mlh-easy-open-link,
.mlh-easy-copy-link,
.mlh-easy-open-conversations,
.mlh-easy-refresh-bills,
.mlh-easy-edit-location {
  background: #ffffff;
  border-color: #334155;
  color: #0f172a;
}

.mlh-easy-message {
  margin-top: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 20px;
  color: #334155;
  background: #ffffff;
}

.mlh-easy-message.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.mlh-easy-message.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.mlh-easy-chat-link-wrap {
  margin-top: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.mlh-easy-chat-link-wrap label {
  display: block;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.mlh-easy-chat-link-field {
  margin-top: 6px;
  width: 100%;
}

.mlh-easy-chat-link-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mlh-token-builder {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}

.mlh-token-builder-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: #334155;
}

.mlh-token-builder-help {
  margin: 0 0 8px;
  font-size: 12px;
  color: #475569;
}

.mlh-token-builder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mlh-token-builder .mlh-token-insert {
  font-size: 11px;
  border-radius: 999px;
}

.mlh-token-builder-table {
  font-size: 12px;
}

.mlh-token-builder-table th,
.mlh-token-builder-table td {
  padding: 6px 8px;
}

@media (max-width: 768px) {
  .mlh-result-item {
    flex-direction: column;
  }

  .mlh-reminder-dialog {
    padding: 12px;
  }
}

.mlh-gallery-app {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 30%);
}

.mlh-gallery-header h2 {
  margin: 0 0 6px;
}

.mlh-gallery-header p {
  margin: 0 0 12px;
  color: #475569;
  flex: 1 1 100%;
}

.mlh-gallery-header {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.mlh-gallery-collapse-toggle {
  white-space: nowrap;
}

.mlh-gallery-shell[hidden] {
  display: none !important;
}

.mlh-gallery-toolbar {
  display: grid;
  grid-template-columns: 1.8fr repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.mlh-gallery-toolbar input[type="search"],
.mlh-gallery-toolbar select {
  width: 100%;
  min-height: 36px;
}

.mlh-gallery-view-switch {
  display: inline-flex;
  gap: 6px;
}

.mlh-gallery-view-switch .mlh-inline-btn.is-active {
  background: #0f172a;
  color: #ffffff;
}

.mlh-gallery-upload-box {
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 12px;
}

.mlh-gallery-upload-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.mlh-gallery-upload-row label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.mlh-gallery-upload-btn {
  min-height: 36px;
  background: #166534;
  border-color: #166534;
  color: #ffffff;
}

.mlh-gallery-help {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
}

.mlh-gallery-status {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 20px;
  background: #ffffff;
  color: #334155;
}

.mlh-gallery-status.is-error {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #991b1b;
}

.mlh-gallery-status.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.mlh-gallery-count {
  margin: 8px 0;
  color: #475569;
  font-size: 13px;
}

.mlh-gallery-collection {
  display: grid;
  gap: 10px;
}

.mlh-gallery-collection.mlh-gallery-view-grid-large {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.mlh-gallery-collection.mlh-gallery-view-grid-small {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.mlh-gallery-collection.mlh-gallery-view-list {
  grid-template-columns: 1fr;
}

.mlh-gallery-item {
  border: 1px solid #d7dee7;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.04);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.mlh-gallery-view-list .mlh-gallery-item {
  grid-template-columns: 180px 1fr auto;
  grid-template-rows: 1fr;
  align-items: stretch;
}

.mlh-gallery-item-media {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  min-height: 160px;
}

.mlh-gallery-view-grid-small .mlh-gallery-item-media {
  min-height: 120px;
}

.mlh-gallery-view-list .mlh-gallery-item-media {
  min-height: 100%;
}

.mlh-gallery-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mlh-gallery-item-thumb-fallback {
  display: grid;
  place-items: center;
  min-height: 160px;
  font-weight: 700;
  color: #334155;
}

.mlh-gallery-item-body {
  padding: 10px;
}

.mlh-gallery-item-body h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.mlh-gallery-item-body p {
  margin: 4px 0;
  color: #475569;
  font-size: 13px;
}

.mlh-gallery-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}

.mlh-gallery-item-actions .mlh-inline-btn {
  font-size: 12px;
}

.mlh-gallery-item-actions .mlh-gallery-delete-media {
  border-color: #dc2626;
  color: #b91c1c;
}

.mlh-gallery-item-actions .mlh-gallery-delete-media:hover {
  background: #fff1f2;
}

.mlh-gallery-item-edit {
  border-top: 1px solid #e2e8f0;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.mlh-gallery-item-edit label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.mlh-gallery-item-edit-actions {
  display: flex;
  gap: 6px;
}

.mlh-gallery-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: #64748b;
  background: #ffffff;
}

.mlh-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.9);
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.mlh-gallery-lightbox figure {
  margin: 0;
  display: grid;
  gap: 8px;
}

.mlh-gallery-lightbox-image {
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
  background: #0b1220;
  border-radius: 12px;
}

.mlh-gallery-lightbox-caption {
  color: #cbd5e1;
  text-align: center;
}

.mlh-gallery-lightbox-close,
.mlh-gallery-lightbox-prev,
.mlh-gallery-lightbox-next {
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

.mlh-gallery-file-embed img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #dbe2ea;
}

.mlh-conversation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.mlh-conversation-card {
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.04);
}

.mlh-conversation-card.is-open {
  border-color: #bfdbfe;
}

.mlh-conversation-card.is-closed {
  border-color: #fecaca;
  background: #fff7f7;
}

.mlh-conversation-card header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mlh-conversation-card header h3 {
  margin: 0;
  font-size: 16px;
}

.mlh-conversation-status {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.mlh-conversation-status.is-open {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.mlh-conversation-status.is-closed {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.mlh-conversation-card p {
  margin: 4px 0;
  color: #334155;
  font-size: 13px;
}

.mlh-conversation-unread {
  margin-top: 6px;
  border: 1px solid #facc15;
  background: #fef9c3;
  color: #854d0e;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.mlh-conversation-actions {
  margin-top: 8px;
}

.mlh-conversation-reply-form,
.mlh-conversation-close-form {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.mlh-conversation-reply-form label {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.mlh-conversation-reply-form textarea,
.mlh-conversation-reply-form input[type="text"] {
  width: 100%;
}

.mlh-conversation-btn-close {
  border-color: #dc2626;
  color: #991b1b;
}

@media (max-width: 1024px) {
  .mlh-gallery-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .mlh-gallery-upload-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mlh-gallery-view-list .mlh-gallery-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .mlh-gallery-lightbox {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .mlh-gallery-lightbox-prev,
  .mlh-gallery-lightbox-next {
    order: 3;
  }
}
