:root {
    --hm-admin-bg: #f4f1eb;
    --hm-admin-surface: #ffffff;
    --hm-admin-ink: #17191d;
    --hm-admin-muted: #737982;
    --hm-admin-line: rgba(23, 25, 29, 0.12);
    --hm-admin-dark: #15171a;
    --hm-admin-dark-2: #202329;
    --hm-admin-accent: #c8874a;
    --hm-admin-radius-lg: 24px;
    --hm-admin-radius-md: 16px;
    --hm-admin-shadow: 0 20px 60px rgba(31, 28, 23, 0.12);
    --hm-admin-shadow-soft: 0 10px 30px rgba(31, 28, 23, 0.08);
    --hm-admin-font: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html,
body,
.hm-admin-page,
.hm-admin-shell {
    min-height: 100vh;
    font-family: var(--hm-admin-font);
    color: var(--hm-admin-ink);
    background:
        radial-gradient(circle at 20% 0%, rgba(200, 135, 74, 0.15), transparent 30rem),
        linear-gradient(135deg, #fbfaf7 0%, var(--hm-admin-bg) 62%, #ece7dd 100%);
}

.hm-admin-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent;
    overflow: visible;
}

.hm-admin-layout {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    align-items: stretch;
    overflow: visible;
}

.hm-admin-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
}

.hm-admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 12px 22px;
    color: #fff;
    background: rgba(23, 24, 29, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.hm-admin-brand,
.hm-admin-brand:hover,
.hm-admin-brand:focus {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.hm-admin-brand__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hm-admin-logo__img {
    width: 150px;
    max-height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.hm-admin-user-menu {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.hm-admin-user-link,
.hm-admin-user-link:focus,
.hm-admin-user-link:hover {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.hm-admin-user-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.36);
}

.hm-admin-user-avatar .hm-admin-user-image-fallback {
    display: none;
    font-size: 15px;
    color: #fff;
}

.hm-admin-user-avatar.is-empty .hm-admin-user-image {
    display: none;
}

.hm-admin-user-avatar.is-empty .hm-admin-user-image-fallback {
    display: inline;
}

.hm-admin-user-image {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.hm-admin-user-text {
    display: inline-flex;
    align-items: center;
}

.hm-admin-user-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.hm-admin-user-logout.hm-admin-logout-btn {
    min-height: 32px;
    min-width: 95px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.hm-admin-user-logout.hm-admin-logout-btn:hover,
.hm-admin-user-logout.hm-admin-logout-btn:focus {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.2);
}

.hm-admin-logout-icon {
    font-size: 12px;
    opacity: 0.9;
}

.hm-admin-sidebar {
    width: 260px;
    flex: 0 0 260px;
    min-height: calc(100vh - 72px);
    background: var(--hm-admin-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hm-admin-sidebar-inner {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    padding: 16px 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-admin-nav-shell {
    width: 100%;
}

.hm-admin-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
}

.hm-admin-nav-item {
    margin: 0;
}

.hm-admin-nav-link,
.hm-admin-nav-sublink {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    font-weight: 600;
    box-sizing: border-box;
    transition: background 140ms ease, color 140ms ease;
}

.hm-admin-nav-link:hover,
.hm-admin-nav-link:focus,
.hm-admin-nav-sublink:hover,
.hm-admin-nav-sublink:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hm-admin-nav-item.is-active > .hm-admin-nav-link,
.hm-admin-nav-item.is-active > details > .hm-admin-nav-link,
.hm-admin-nav-submenu .hm-admin-nav-item.is-active .hm-admin-nav-sublink {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hm-admin-nav-icon {
    width: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.74);
}

.hm-admin-nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-admin-nav-details {
    margin: 0;
}

.hm-admin-nav-details > summary {
    list-style: none;
    cursor: pointer;
    padding-right: 14px;
}

.hm-admin-nav-details > summary::-webkit-details-marker {
    display: none;
}

.hm-admin-nav-details > summary::after {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    margin-left: auto;
    border-right: 2px solid rgba(255, 255, 255, 0.72);
    border-bottom: 2px solid rgba(255, 255, 255, 0.72);
    transform: rotate(-45deg);
    transition: transform 120ms ease;
}

.hm-admin-nav-details[open] > summary::after {
    transform: rotate(45deg);
}

.hm-admin-nav-submenu {
    margin: 4px 0 6px 32px;
    padding: 0 0 0 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    list-style: none;
    display: grid;
    gap: 3px;
}

.hm-admin-nav-sublink {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
    gap: 9px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: 600;
}

.hm-admin-nav-submarker {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.58;
}

.hm-admin-nav-sublabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-admin-nav-submenu .hm-admin-nav-item.is-active .hm-admin-nav-submarker,
.hm-admin-nav-sublink:hover .hm-admin-nav-submarker,
.hm-admin-nav-sublink:focus .hm-admin-nav-submarker {
    opacity: 1;
}

.hm-admin-content-wrapper {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(100vh - 72px);
    background: transparent;
}

.hm-admin-content-header {
    padding: 24px 26px 0;
}

.hm-admin-content {
    padding: 18px 26px 24px;
}

.hm-admin-content-wrapper {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(100vh - 64px);
    background: transparent;
}

.hm-admin-content-header {
    padding: 28px 32px 0;
}

.hm-admin-title-block {
    padding: 24px 26px;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: var(--hm-admin-radius-lg);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--hm-admin-shadow-soft);
}

.content-header > h1,
.hm-admin-title-block h1 {
    margin: 0;
    color: var(--hm-admin-ink);
    font-size: clamp(26px, 3vw, 42px);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.hm-admin-breadcrumb,
.content-header > .breadcrumb {
    position: static;
    float: none;
    margin: 10px 0 0;
    padding: 0;
    background: transparent;
    color: var(--hm-admin-muted);
}

.hm-admin-content {
    padding: 24px 32px 32px;
}

.hm-admin-title-block > h1 > small {
    font-size: .95rem;
    font-weight: 400;
    color: #6b7280;
}

.hm-admin-page-card {
    min-height: 260px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.grid-view,
.detail-view,
.site-index > .row,
.site-contact,
.site-about,
.site-error,
.site-userdata,
.ta-index,
.payment-index,
.stat-index,
.hm-dashboard-panel,
.hm-dashboard-card,
.hm-kpi-card {
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: var(--hm-admin-radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--hm-admin-shadow-soft);
}

.hm-admin-page-card > .row,
.site-index > .row {
    margin-left: 0;
    margin-right: 0;
    padding: 18px;
}

.hm-kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.hm-kpi-card {
    border-radius: var(--hm-admin-radius-md);
    background: rgba(255, 255, 255, 0.94);
    padding: 16px;
    min-height: 118px;
    display: grid;
    gap: 8px;
}

.hm-kpi-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.hm-kpi-card__title {
    margin: 0;
    color: var(--hm-admin-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hm-kpi-card__value {
    margin: 0;
    font-size: 34px;
    color: var(--hm-admin-ink);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hm-kpi-card__subline {
    margin: 0;
    color: var(--hm-admin-muted);
    font-size: 12px;
}

.hm-kpi-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
    background: rgba(31, 41, 55, 0.08);
    flex: 0 0 38px;
}

.hm-kpi-card__icon--danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
}

.hm-kpi-card__icon--warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
}

.hm-kpi-card__icon--success {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
}

.hm-kpi-progress {
    margin-top: 2px;
    height: 4px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.12);
    overflow: hidden;
}

.hm-kpi-progress__fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #1f2937;
}

.hm-kpi-progress--warning .hm-kpi-progress__fill {
    background: linear-gradient(90deg, #f97316, #eab308);
}

.hm-kpi-progress--danger .hm-kpi-progress__fill {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.hm-kpi-progress--success .hm-kpi-progress__fill {
    background: linear-gradient(90deg, #059669, #10b981);
}

.hm-dashboard-card {
    border-radius: var(--hm-admin-radius-md);
    background: rgba(255, 255, 255, 0.94);
    overflow: hidden;
}

.hm-dashboard-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(23, 25, 29, 0.08);
}

.hm-dashboard-card__title {
    margin: 0;
    font-size: 18px;
    color: var(--hm-admin-ink);
    font-weight: 700;
}

.hm-dashboard-card__body {
    padding: 14px 16px;
}

.hm-dashboard-card__footer {
    padding: 0 16px 12px;
    color: var(--hm-admin-muted);
    font-size: 12px;
}

.hm-dashboard-collapsible {
    margin: 0;
}

.hm-dashboard-collapsible > .hm-dashboard-card__header {
    cursor: pointer;
    position: relative;
}

.hm-dashboard-collapsible > .hm-dashboard-card__header::after {
    display: none;
}

.hm-dashboard-collapsible__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 99px;
    color: var(--hm-admin-ink);
    background: rgba(23, 25, 29, 0.07);
    transition: transform 0.18s ease, color 0.18s ease;
}

.hm-dashboard-collapsible:not([open]) .hm-dashboard-collapsible__icon {
    transform: rotate(-90deg);
}

.hm-dashboard-collapsible .hm-dashboard-card__body {
    display: block;
}

.hm-dashboard-collapsible:not([open]) .hm-dashboard-card__body {
    display: none;
}

.hm-dashboard-card .table-responsive {
    margin: -1px;
}

.hm-dashboard-card + .hm-dashboard-card {
    margin-top: 12px;
}

.hm-chart-container {
    width: 100%;
}

.hm-chart {
    width: 100% !important;
    min-height: 320px;
}

.hm-dashboard-card .table {
    margin-bottom: 0;
}

.hm-kpi-grid + .hm-dashboard-card,
.hm-kpi-grid + .hm-kpi-card {
    margin-top: 2px;
}

.hm-dashboard-card-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table,
.grid-view table {
    margin-bottom: 0;
    background: #fff;
    border-radius: var(--hm-admin-radius-md);
    overflow: hidden;
}

.table > thead > tr > th,
.grid-view th {
    border-bottom: 1px solid var(--hm-admin-line);
    color: var(--hm-admin-muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
    border-top: 1px solid rgba(23, 25, 29, 0.07);
    vertical-align: middle;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    min-height: 44px;
    border: 1px solid rgba(23, 25, 29, 0.14);
    border-radius: 14px;
    box-shadow: none;
    color: var(--hm-admin-ink);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(200, 135, 74, 0.8);
    box-shadow: 0 0 0 4px rgba(200, 135, 74, 0.13);
}

.btn,
.btn-flat {
    border-radius: 999px !important;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary,
.btn-success,
.btn-info {
    border: none;
    background: linear-gradient(135deg, #1b1e23, #30343b) !important;
    color: #fff !important;
    box-shadow: 0 12px 26px rgba(23, 25, 29, 0.14);
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-success:focus,
.btn-info:focus {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #000, #272b31) !important;
}

.hm-copy-btn {
    min-width: 90px;
}

.btn-default {
    border: 1px solid var(--hm-admin-line);
    background: #fff;
    color: var(--hm-admin-ink);
}

.alert {
    border: none;
    border-radius: 16px;
    box-shadow: var(--hm-admin-shadow-soft);
}

.hm-admin-footer,
.main-footer {
    width: 100%;
    flex: 0 0 auto;
    border: none;
    background: rgba(15, 17, 20, 0.82);
    color: #cfd4dc;
    padding: 16px 24px;
    backdrop-filter: blur(18px);
}

.hm-admin-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
}

.hm-admin-footer-brand,
.hm-admin-footer-meta {
    margin: 0;
    display: inline-flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.hm-admin-footer-brand a,
.hm-admin-footer-meta a {
    color: #f4f7ff;
}

.hm-admin-footer-brand a:hover,
.hm-admin-footer-meta a:hover,
.hm-admin-footer-brand a:focus,
.hm-admin-footer-meta a:focus {
    text-decoration: underline;
    color: #ffffff;
}

.hm-login-page,
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 10%, rgba(200, 135, 74, 0.22), transparent 26rem),
        linear-gradient(135deg, #111318, #202329 58%, #34291f 100%) !important;
}

.hm-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.hm-login-alerts {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 20;
    width: min(480px, calc(100% - 32px));
    transform: translateX(-50%);
}

.hm-login-box,
.login-box.hm-login-box {
    width: min(420px, 100%);
    margin: 0;
}

.hm-login-logo {
    margin-bottom: 18px;
}

.hm-login-logo img {
    width: 190px;
    max-height: 80px;
    filter: invert(100%);
}

/* Passwort vergessen / neues Passwort / Bestaetigungs-Mail: gleiche Karte wie der Login, darunter der Weg zurueck. */
.hm-auth-back {
    margin-top: 18px;
    text-align: center;
}

.hm-auth-back a {
    color: var(--hm-admin-muted);
    font-weight: 700;
}

.hm-admin-error-shell {
    color: #fff;
    padding-top: 10%;
}

.hm-admin-error-page {
    padding-top: 50px;
}

.hm-login-panel,
.login-box-body.hm-login-panel {
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

.hm-login-panel h1 {
    margin: 0 0 6px;
    color: var(--hm-admin-ink);
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.hm-eyebrow {
    margin-bottom: 10px;
    color: var(--hm-admin-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-box-msg {
    padding: 0 0 22px;
    color: var(--hm-admin-muted);
    text-align: left;
}

.hm-login-field .form-control {
    padding-left: 16px;
    padding-right: 46px;
}

.hm-login-field.has-feedback {
    position: relative;
}

.hm-login-field .form-control-feedback {
    position: absolute;
    top: 0;
    right: 10px;
    width: 32px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hm-admin-muted);
    line-height: 1;
    pointer-events: none;
}

.hm-login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 22px;
    color: var(--hm-admin-muted);
}

.hm-login-meta .form-group {
    margin: 0;
}

.hm-login-meta .checkbox {
    margin: 0;
}

.hm-login-meta .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    padding-left: 0;
}

.hm-login-meta .checkbox input[type="checkbox"] {
    position: static;
    margin: 0;
}

.hm-login-meta a {
    color: var(--hm-admin-muted);
    font-weight: 700;
}

.hm-dashboard-settings-row {
    margin: 0;
}

.hm-dashboard-panel {
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: var(--hm-admin-radius-md);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--hm-admin-shadow-soft);
    padding: 20px;
    margin-bottom: 16px;
}

.hm-dashboard-panel .row {
    margin-left: 0;
    margin-right: 0;
}

.hm-dashboard-panel h4,
.hm-dashboard-panel h5 {
    margin-top: 0;
}

.hm-dashboard-actions {
    margin-top: 16px;
}

.hm-user-image-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 14px 0 20px;
}

.hm-user-image {
    height: 96px;
    width: 96px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    background-color: #000;
    border-radius: 12px;
    object-fit: contain;
    object-position: center;
}

.hm-upload-form {
    margin-top: 12px;
}

.hm-code-block-wrap {
    display: grid;
    gap: 14px;
}

.hm-code-block {
    margin: 0;
    max-height: 240px;
    overflow: auto;
    background: #0f1115;
    color: #dce0eb;
    border: 1px solid #2f3340;
    border-radius: 14px;
    padding: 12px;
}

.hm-help-text {
    color: var(--hm-admin-muted);
}

@media (max-width: 767px) {
    .main-header .logo,
    .main-header .navbar {
        min-height: 58px;
    }

    .main-sidebar {
        padding-top: 58px;
    }

    .hm-admin-topbar {
        min-height: auto;
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .hm-admin-logo__img {
        width: 132px;
    }

    .hm-admin-user-menu {
        margin-left: auto;
        gap: 8px;
    }

    .hm-admin-user-name {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hm-admin-layout {
        flex-direction: column;
    }

    .hm-admin-main {
        min-height: auto;
    }

    .hm-admin-sidebar {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hm-admin-sidebar-inner {
        position: static;
        max-height: none;
        padding: 10px 12px;
    }

    .hm-admin-nav-submenu {
        margin-left: 18px;
    }

    .hm-admin-content-header,
    .hm-admin-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hm-admin-title-block,
    .hm-admin-page-card > .row,
    .site-index > .row {
        border-radius: 20px;
        padding: 16px;
    }

    .hm-admin-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .hm-login-panel,
    .login-box-body.hm-login-panel {
        padding: 26px 20px;
    }

    .hm-login-meta {
        display: block;
    }
}

.hm-debug-page {
    display: grid;
    gap: 16px;
    max-width: 1440px;
    margin: 0 auto;
}

.hm-debug-hero,
.hm-debug-card {
    background: #fff;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(32, 48, 74, .05);
    padding: 20px 22px;
}

.hm-debug-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    box-shadow: none;
}

.hm-debug-hero h1,
.hm-debug-card h2,
.hm-debug-card h3 {
    margin-top: 0;
    letter-spacing: 0;
}

.hm-debug-hero h1 {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.15;
}

.hm-debug-hero p:last-child,
.hm-debug-card p:last-child {
    margin-bottom: 0;
}

.hm-debug-eyebrow {
    display: block;
    margin: 0 0 8px;
    color: #386e43;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hm-debug-legend,
.hm-debug-actions,
.hm-debug-copy-row,
.hm-debug-link-row,
.hm-debug-safe-details-head {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.hm-debug-actions .btn,
.hm-debug-copy-row .btn,
.hm-debug-link-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.hm-debug-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .9fr) minmax(170px, .6fr) minmax(170px, .6fr);
    gap: 14px;
    align-items: start;
}

.hm-debug-search-card .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.hm-debug-search-card .control-label {
    min-height: 20px;
}

.hm-debug-summary,
.hm-debug-explain-grid,
.hm-debug-demo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hm-debug-explain-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hm-debug-kpi,
.hm-debug-explain-grid article,
.hm-debug-demo-card {
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #fafbfc;
    padding: 14px;
}

.hm-debug-kpi > span,
.hm-debug-demo-card span,
.hm-debug-demo-card small,
.hm-debug-role,
.hm-debug-meta dt {
    color: #5e6a78;
}

.hm-debug-kpi strong {
    display: block;
    color: #102033;
    font-size: 18px;
    line-height: 1.25;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.hm-debug-demo-card {
    color: #111827;
    display: grid;
    gap: 6px;
    min-height: 118px;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.hm-debug-demo-card:hover {
    border-color: #386e43;
    color: #111827;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(32, 48, 74, .12);
}

.hm-debug-demo-card:focus-visible,
.hm-debug-copy:focus-visible,
.hm-debug-demo-panel summary:focus-visible {
    outline: 3px solid rgba(38, 132, 255, .55);
    outline-offset: 3px;
}

.hm-debug-demo-card:active,
.hm-debug-demo-card:visited {
    color: #111827;
    text-decoration: none;
}

.hm-debug-demo-card strong {
    font-size: 15px;
    line-height: 1.25;
}

.hm-debug-demo-card code {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-debug-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.hm-debug-section-head > p {
    max-width: 560px;
    color: #5e6a78;
}

.hm-debug-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .02em;
    white-space: nowrap;
}

.hm-debug-badge-mark {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.hm-debug-ok { background: #e7f8ef; color: #0e6f3f; border: 1px solid #bce8cf; }
.hm-debug-warning { background: #fff4db; color: #7a4d00; border: 1px solid #f1d18b; }
.hm-debug-error { background: #ffe8e5; color: #8f2017; border: 1px solid #f3b4ad; }
.hm-debug-unknown { background: #edf2f7; color: #2f4a62; border: 1px solid #d4dee8; }
.hm-debug-muted { background: #f3f4f6; color: #4f5b67; border: 1px solid #e5e7eb; }

.hm-debug-cause {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
    gap: 16px;
    margin-top: 18px;
    border-top: 1px solid #e5ebf2;
    padding-top: 18px;
}

.hm-debug-cause h3 {
    font-size: 22px;
    line-height: 1.3;
}

.hm-debug-action-box {
    border-left: 4px solid #386e43;
    background: #f5f8f6;
    border-radius: 8px;
    padding: 12px 14px;
}

.hm-debug-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.hm-debug-meta div {
    border-top: 1px solid #e5ebf2;
    padding-top: 10px;
}

.hm-debug-meta dt {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.hm-debug-meta dd {
    margin: 3px 0 0;
    color: #102033;
    overflow-wrap: anywhere;
}

.hm-debug-link-row {
    margin-top: 16px;
}

.hm-debug-copy-status {
    min-height: 18px;
    margin-top: 10px;
    color: #386e43;
    font-weight: 700;
}

.hm-debug-check-groups,
.hm-debug-demo-groups {
    display: grid;
    gap: 14px;
}

.hm-debug-check-group,
.hm-debug-demo-group {
    border-top: 1px solid #e5ebf2;
    padding-top: 14px;
}

.hm-debug-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.hm-debug-timeline li {
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.hm-debug-timeline header {
    display: grid;
    grid-template-columns: minmax(150px, .45fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.hm-debug-area {
    width: max-content;
    max-width: 100%;
    border-radius: 999px;
    background: #edf2f7;
    color: #2f4a62;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.hm-debug-timeline p {
    margin: 9px 0 0;
}

.hm-debug-timeline pre {
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.hm-debug-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.hm-debug-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.hm-debug-table th,
.hm-debug-table td {
    border-bottom: 1px solid #e5ebf2;
    padding: 10px;
    vertical-align: top;
    text-align: left;
}

.hm-debug-support {
    width: 100%;
    min-height: 150px;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
    resize: vertical;
}

.hm-debug-safe-details {
    margin-top: 14px;
}

.hm-debug-safe-details summary,
.hm-debug-demo-panel summary {
    cursor: pointer;
}

.hm-debug-demo-panel summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.hm-debug-demo-panel summary strong {
    display: block;
    color: #102033;
    font-size: 18px;
}

.hm-debug-demo-panel summary small {
    color: #5e6a78;
}

.hm-debug-demo-groups {
    margin-top: 16px;
}

@media (max-width: 1100px) {
    .hm-debug-grid,
    .hm-debug-summary,
    .hm-debug-demo-grid,
    .hm-debug-meta {
        grid-template-columns: 1fr 1fr;
    }

    .hm-debug-explain-grid,
    .hm-debug-cause {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .hm-debug-hero,
    .hm-debug-section-head,
    .hm-debug-demo-panel summary {
        display: block;
    }

    .hm-debug-grid,
    .hm-debug-summary,
    .hm-debug-demo-grid,
    .hm-debug-meta,
    .hm-debug-timeline header {
        grid-template-columns: 1fr;
    }

    .hm-debug-hero,
    .hm-debug-card {
        padding: 16px;
    }
}
