:root,
.theme-intercasino {
    --bg-body: #f2f3f5;
    --bg-surface: #ffffff;
    --bg-subtle: #f7f7f8;
    --bg-header: #3b0714;
    --bg-header-light: #530b1f;
    --border-soft: #e2e3e6;
    --border-strong: #cfd1d6;
    --text-main: #1f2329;
    --text-muted: #686d75;
    --primary: #941b3b;
    --primary-dark: #73132e;
    --primary-soft: #f8edf0;
    --accent-gold: #c7a45b;
    --danger: #b5282f;
    --danger-soft: #fff0f1;
    --success: #16834b;
    --success-soft: #eaf8f0;
    --shadow-soft: 0 8px 24px rgba(31, 35, 41, 0.07);
    --radius-card: 8px;
    --radius-input: 6px;
    --radius-pill: 999px;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

html {
    min-height: 100%;
    background: var(--bg-body);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 14px;
    letter-spacing: 0;
}

::selection {
    background: #ecd5dc;
    color: #310510;
}

a,
button,
input,
select,
textarea {
    letter-spacing: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(148, 27, 59, 0.18);
    outline-offset: 2px;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 64px;
    padding: 0 max(24px, calc((100vw - 1320px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--bg-header);
    border-bottom: 2px solid var(--accent-gold);
    box-shadow: 0 5px 18px rgba(35, 6, 14, 0.18);
}

.app-header__left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 34px;
}

.app-header__brand,
.app-header a.app-header__brand,
.app-header a.app-header__brand:link,
.app-header a.app-header__brand:visited {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.app-header__brand-mark,
.login-brand__mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: #71122d;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.app-header__brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.app-header__brand-primary {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
}

.app-header__brand-secondary {
    color: #d8bec5;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
}

.app-header__nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
}

.app-header__nav a,
.app-header__nav a:link,
.app-header__nav a:visited {
    min-height: 62px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    color: #decbd0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.app-header__nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.app-header__nav a.is-active {
    border-bottom-color: #e1c47f;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.app-header__right {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
}

.user-menu__toggle {
    min-height: 36px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #f5e9ec;
    cursor: pointer;
    font: inherit;
}

.user-menu__toggle:hover,
.user-menu.is-open .user-menu__toggle {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.user-menu__name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__chevron {
    font-size: 15px;
    line-height: 1;
    opacity: 0.75;
}

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    min-width: 180px;
    padding: 6px;
    display: none;
    border: 1px solid #6f273a;
    border-radius: 8px;
    background: #31050f;
    box-shadow: 0 16px 36px rgba(31, 4, 11, 0.35);
}

.user-menu.is-open .user-menu__dropdown {
    display: block;
}

.user-menu__dropdown a,
.user-menu__dropdown form button {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #f1e2e6;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
}

.user-menu__dropdown a:hover,
.user-menu__dropdown form button:hover {
    background: #5a1023;
}

.user-menu__dropdown form {
    margin: 5px 0 0;
    padding-top: 5px;
    border-top: 1px solid #682238;
}

/* Page structure */
.app-container {
    width: min(100%, 1352px);
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.app-nav {
    min-height: 20px;
    margin: 0 0 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: #8a8f97;
    font-size: 12px;
}

.app-nav a,
.app-nav a:visited {
    margin: 0;
    color: #7f1733;
    font-weight: 650;
    text-decoration: none;
}

.app-nav a:hover,
.section-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.page-heading {
    min-height: 58px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.page-heading--compact {
    min-height: 50px;
    margin-bottom: 14px;
}

.page-heading h1,
.page-header h1 {
    margin: 2px 0 0;
    color: #20242a;
    font-size: 24px;
    font-weight: 750;
    line-height: 1.2;
}

.page-eyebrow {
    color: #8c1837;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.page-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.automation-status {
    min-height: 34px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #d5d7db;
    border-radius: 6px;
    background: #ffffff;
    color: #555b63;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.automation-status--active {
    border-color: #8bcea8;
    background: var(--success-soft);
    color: #116a3c;
}

.automation-status--active .tag-dot {
    background: var(--success);
}

.automation-status--inactive .tag-dot {
    background: var(--danger);
}

.section-heading {
    margin: 24px 0 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
}

.section-heading p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.section-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.overview-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
}

.overview-metric {
    min-height: 92px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-soft);
}

.overview-metric:last-child {
    border-right: 0;
}

.overview-metric__label {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.overview-metric strong {
    color: #25292f;
    font-size: 24px;
    line-height: 1;
}

.overview-metric--success strong {
    color: var(--success);
}

.overview-metric--danger strong {
    color: var(--danger);
}

/* Cards and panels */
.app-card,
.panel,
.firm-card {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
}

.app-card,
.panel {
    padding: 18px;
}

.panel,
.log-summary {
    margin-bottom: 16px;
}

.panel-narrow {
    max-width: 720px;
}

.panel-wide {
    max-width: 1120px;
}

.panel-form {
    max-width: 920px;
}

.panel-header,
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page-header {
    margin-bottom: 18px;
}

.panel-header {
    margin-bottom: 16px;
}

.panel-header h2,
.setting-panel h2 {
    margin: 0;
    font-size: 16px;
}

.panel-header p,
.setting-panel p,
.page-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.settings-grid,
.metric-grid {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.setting-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.setting-value {
    color: var(--primary);
    font-size: 17px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
}

.card-subtitle {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.empty-state {
    padding: 28px 16px !important;
    color: var(--text-muted);
    text-align: center;
}

/* Buttons */
.btn,
.button {
    min-height: 34px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled,
.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary,
.button-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.button-primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(115, 19, 46, 0.18);
}

.btn-secondary,
.btn-light,
.button-secondary {
    border-color: #d3c5c9;
    background: #ffffff;
    color: #3a3033;
}

.btn-secondary:hover,
.btn-light:hover,
.button-secondary:hover {
    border-color: #b897a0;
    background: #faf5f6;
}

.btn-quiet,
.button-quiet {
    border-color: transparent;
    background: transparent;
    color: #646970;
}

.btn-quiet:hover,
.button-quiet:hover {
    background: #eff0f2;
    color: #292d33;
}

.btn-danger,
.button-danger {
    border-color: #efc1c4;
    background: var(--danger-soft);
    color: #a21f27;
}

.btn-danger:hover,
.button-danger:hover {
    border-color: #df9da2;
    background: #fbdfe1;
}

.btn-xs,
.button-small,
.btn-sm {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px;
}

.button-block,
.login-submit {
    width: 100%;
}

.inline-action {
    display: inline-flex;
    margin: 0;
}

.action-cell {
    white-space: normal;
}

.action-cell > .btn,
.action-cell > .inline-action {
    margin: 2px 1px;
}

/* Tables */
.table-wrapper {
    margin-top: 0;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid #e8e8ea;
    color: #2b2f35;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f6f5f6;
    color: #686269;
    font-size: 11px;
    font-weight: 750;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbf8f9;
}

.table-primary {
    color: #20242a;
    font-size: 13px;
    font-weight: 750;
}

.table-secondary {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
}

.truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.count-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.count-cluster span,
.mobile-count-grid span {
    min-width: 58px;
    padding: 5px 7px;
    border: 1px solid #e1e2e5;
    border-radius: 5px;
    background: #f7f7f8;
    color: #666b72;
    font-size: 10px;
    white-space: nowrap;
}

.count-cluster strong,
.mobile-count-grid strong {
    color: #272b31;
    font-size: 12px;
}

/* Status */
.tag,
.badge {
    min-height: 23px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.tag-dot,
.status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    display: inline-block;
    border-radius: 50%;
}

.tag-active,
.badge-success {
    border: 1px solid #7bc99e;
    background: var(--success-soft);
    color: #106a3c;
}

.tag-active .tag-dot,
.status-dot--green {
    background: var(--success);
}

.tag-passive,
.badge-danger {
    border: 1px solid #edb3b7;
    background: var(--danger-soft);
    color: #9f2028;
}

.tag-passive .tag-dot,
.status-dot--red {
    background: var(--danger);
}

.badge-soft {
    border: 1px solid #d9dadd;
    background: #f4f4f5;
    color: #454a51;
}

.status-dot {
    margin-right: 6px;
}

/* Mobile cards */
.card-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 10px;
}

.firm-card {
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.firm-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.firm-title {
    color: #20242a;
    font-size: 14px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.firm-sub {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
    overflow-wrap: anywhere;
}

.firm-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.firm-meta-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.firm-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mobile-count-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.mobile-count-grid span {
    min-width: 0;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label,
.field {
    color: #3b4047;
    font-size: 12px;
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 5px;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.field small,
.hint {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.45;
}

.hint {
    margin-top: 4px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #c9cbd0;
    border-radius: 6px;
    background: #ffffff;
    color: #22262c;
    font: inherit;
    font-size: 13px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #acaeb4;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(148, 27, 59, 0.1);
    outline: none;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.filter-bar {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #ffffff;
}

.filter-row,
.log-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.filter-row select {
    min-width: 130px;
}

.fieldset {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
}

.fieldset legend {
    padding: 0 7px;
    color: #3b4047;
    font-weight: 700;
}

.time-row {
    max-width: 300px;
    display: grid;
    grid-template-columns: minmax(80px, 130px) 12px minmax(80px, 130px);
    align-items: center;
    gap: 8px;
}

.time-separator {
    font-size: 17px;
    font-weight: 750;
    text-align: center;
}

.day-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 7px;
    font-size: 12px;
}

.flash,
.login-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.flash-success {
    border: 1px solid #83cba3;
    background: var(--success-soft);
    color: #0f6b3c;
}

.flash-error,
.login-error {
    border: 1px solid #e9afb4;
    background: var(--danger-soft);
    color: #9f2028;
}

/* Logs */
.log-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.log-header-main {
    max-width: 60%;
}

.log-metrics {
    display: flex;
    gap: 8px;
}

.metric-card {
    min-width: 104px;
    padding: 9px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #f7f7f8;
}

.metric-card--success {
    border-color: #b8ddc7;
    background: var(--success-soft);
    color: #11683b;
}

.metric-card--danger {
    border-color: #eac1c4;
    background: var(--danger-soft);
    color: #9e2028;
}

.metric-label,
.metric-value {
    display: block;
}

.metric-label {
    margin-bottom: 2px;
    font-size: 10px;
}

.metric-value {
    font-size: 18px;
    font-weight: 800;
}

.log-filter-row {
    margin-top: 16px;
    align-items: center;
}

.log-filter-row label {
    margin: 0;
}

.log-filter-row select {
    max-width: 260px;
}

.log-table-card {
    padding: 0;
    overflow: hidden;
}

.log-table-wrap {
    overflow-x: auto;
}

.log-table-card table {
    min-width: 820px;
}

.log-description {
    color: var(--text-muted);
    font-size: 11px;
}

/* Editor and helper surfaces */
#editor-container {
    min-height: 230px;
    background: #ffffff;
}

.ql-toolbar.ql-snow {
    border-radius: 6px 6px 0 0;
}

#editor-container.ql-container.ql-snow {
    border-radius: 0 0 6px 6px;
    font-family: var(--font-main);
    font-size: 13px;
}

.media-current {
    margin-top: 9px;
}

.media-preview {
    max-width: 220px;
    max-height: 220px;
    margin-top: 5px;
    display: block;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #f4f4f5;
    object-fit: contain;
}

.media-download {
    margin-top: 7px;
}

.btn-builder,
.help-note,
.help-code {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #f7f7f8;
}

.btn-builder {
    margin-top: 9px;
    padding: 14px;
}

.btn-builder-row,
.btn-builder-controls,
.btn-builder-actions,
.btn-builder-rows-header,
.btn-row-header,
.btn-row-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.btn-builder-row,
.btn-builder-rows-header,
.btn-row-header {
    justify-content: space-between;
}

.btn-builder-url,
.btn-item {
    min-width: 180px;
    flex: 1;
}

.btn-builder-rows {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #dedfe2;
    border-radius: 6px;
    background: #f1f1f3;
}

#btnBuilderRows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-row {
    padding: 9px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #ffffff;
}

.btn-row-remove {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8b8f96;
    cursor: pointer;
}

.btn-row-remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

#btnBuilderJson {
    min-height: 140px;
    margin-top: 7px;
    background: #f3f3f4;
    font-family: Consolas, monospace;
    font-size: 11px;
}

.help-section {
    padding: 4px 0 18px;
    border-bottom: 1px solid var(--border-soft);
}

.help-section + .help-section {
    padding-top: 18px;
}

.help-section:last-child {
    border-bottom: 0;
}

.help-section h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.help-section p,
.help-section li {
    font-size: 12px;
    line-height: 1.55;
}

.help-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.help-pill {
    padding: 4px 8px;
    border: 1px solid #dfc5cc;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: #791630;
    font-size: 10px;
}

.help-note,
.help-code {
    padding: 10px 12px;
}

.help-code {
    overflow-x: auto;
    font-family: Consolas, monospace;
    font-size: 11px;
    white-space: nowrap;
}

/* Login */
.login-page {
    position: relative;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #eceef1;
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 34%;
    background: var(--bg-header);
    border-bottom: 2px solid var(--accent-gold);
}

.login-box {
    position: relative;
    z-index: 1;
    width: min(100%, 400px);
    max-width: 400px;
    padding: 28px;
    border: 1px solid #d9dadd;
    border-top: 3px solid var(--primary);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(34, 12, 18, 0.17);
}

.login-brand {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-brand__mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.login-brand__name {
    color: #3b0714;
    font-size: 18px;
    font-weight: 850;
}

.login-box__eyebrow {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 850;
    text-align: center;
}

.login-box__title {
    margin-bottom: 4px;
    color: #24282e;
    font-size: 20px;
    font-weight: 750;
    text-align: center;
}

.login-box__subtitle {
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.login-submit {
    min-height: 40px;
    margin-top: 2px;
}

/* Compatibility for the currently running cached dashboard template. */
.page-dashboard .app-container > .app-nav:first-child {
    display: none;
}

.page-dashboard .app-container > .app-card:first-of-type {
    margin-top: 4px;
}

.page-dashboard .table-wrapper:not(.dashboard-table) th:nth-child(1),
.page-dashboard .table-wrapper:not(.dashboard-table) td:nth-child(1),
.page-dashboard .table-wrapper:not(.dashboard-table) th:nth-child(4),
.page-dashboard .table-wrapper:not(.dashboard-table) td:nth-child(4) {
    display: none;
}

@media (max-width: 900px) {
    .table-wrapper {
        display: none;
    }

    .log-table-card {
        display: block;
    }
}

@media (min-width: 901px) {
    .card-grid {
        display: none;
    }
}

@media (max-width: 760px) {
    .app-header {
        min-height: 104px;
        padding: 8px 12px 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: 42px 45px;
        gap: 6px 10px;
    }

    .app-header__left {
        display: contents;
    }

    .app-header__brand {
        grid-column: 1;
        grid-row: 1;
    }

    .app-header__brand-mark {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 10px;
    }

    .app-header__brand-primary {
        font-size: 14px;
    }

    .app-header__right {
        grid-column: 2;
        grid-row: 1;
    }

    .app-header__nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px;
    }

    .app-header__nav a,
    .app-header__nav a:link,
    .app-header__nav a:visited {
        min-width: 0;
        min-height: 44px;
        padding: 0 5px;
        justify-content: center;
        overflow: hidden;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-container {
        padding: 16px 12px 28px;
    }

    .page-heading,
    .page-header {
        min-height: 0;
        align-items: flex-start;
    }

    .page-heading h1,
    .page-header h1 {
        font-size: 21px;
    }

    .overview-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-metric {
        min-height: 78px;
        padding: 14px;
        border-bottom: 1px solid var(--border-soft);
    }

    .overview-metric:nth-child(2) {
        border-right: 0;
    }

    .overview-metric:nth-child(n+3) {
        border-bottom: 0;
    }

    .overview-metric strong {
        font-size: 21px;
    }

    .section-heading {
        margin-top: 20px;
    }

    .firm-card-actions > .btn,
    .firm-card-actions > .inline-action {
        flex: 1 1 calc(50% - 4px);
    }

    .firm-card-actions > .inline-action .btn {
        width: 100%;
    }

    .log-header {
        flex-direction: column;
    }

    .log-header-main {
        max-width: none;
    }

    .log-metrics {
        width: 100%;
    }

    .metric-card {
        flex: 1;
    }

    .settings-grid,
    .metric-grid,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .filter-row > div,
    .filter-row select,
    .filter-row .btn {
        width: 100%;
    }

    .filter-row > div:last-child {
        align-self: stretch;
    }

    .btn-builder-row,
    .btn-builder-rows-header,
    .btn-builder-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .app-header__brand-secondary {
        display: none;
    }

    .user-menu__name {
        max-width: 72px;
    }

    .page-heading {
        flex-direction: column;
        gap: 12px;
    }

    .page-heading > .btn,
    .page-actions,
    .page-actions .btn {
        width: 100%;
    }

    .page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-page {
        padding: 14px;
    }

    .login-box {
        padding: 24px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
