body {
    margin: 0;
    padding: 12px 14px 24px;
}

.wg-panel {
    font: normal normal normal 11px verdana, arial, sans-serif;
    color: #fff;
    background-color: #2a2a2a;
    border-top: solid 4px #111111;
    border-left: solid 4px #111111;
    border-right: solid 4px #3a3a3a;
    border-bottom: solid 4px #3a3a3a;
    margin: 5px auto 10px auto;
    padding: 1px;
}

.wg-cell {
    border-top: solid 1px #3a3a3a;
    border-left: solid 1px #3a3a3a;
    border-right: solid 1px #111111;
    border-bottom: solid 1px #111111;
    padding: 2px 2px 5px 2px;
    line-height: 21px;
}

.layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
}

.layout-top {
    margin-top: 16px;
}

.forms {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 6px;
}

#countries {
    color: #FFF;
    background-color: #2a2a2a;
    border-top: solid 4px #111111;
    border-left: solid 4px #111111;
    border-right: solid 4px #3a3a3a;
    border-bottom: solid 4px #3a3a3a;
    margin: 5px auto 5px auto;
}

.forms .card.wg-cell {
    margin: 0;
}

.card {
    padding: 10px;
    width: 200px;
    line-height: normal;
}

.card-full {
    width: 100%;
    max-width: 100%;
}

.grid {
    display: grid;
    gap: 6px;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inline-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

input[type="number"],
input[type="text"],
select,
textarea {
    width: 100%;
    box-sizing: border-box;
}

input[type="checkbox"] {
    width: auto;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

a.submit {
    display: inline-block;
    padding: 2px 8px;
    border: solid 1px #444;
    text-decoration: none;
}

.actions-split {
    justify-content: space-between;
}

.actions-top-small {
    margin-top: 6px;
}

.add-country-block {
    display: inline-block;
    margin-top: 6px;
}

.add-country-block .wg-cell {
    line-height: normal;
}

.results-scroll {
    overflow: auto;
}

#resultsTable {
    width: 100%;
}

.results-grid {
    table-layout: fixed;
    width: 100%;
}

.results-grid td,
.results-grid th {
    vertical-align: top;
    min-width: 220px;
}

.results-accordion th,
.results-accordion td {
    min-width: 140px;
}

.header-row th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.country-row {
    cursor: pointer;
}

.country-row.is-expanded .row-head::after {
    content: " ▲";
}

.country-row .row-head::after {
    content: " ▼";
}

.details-cell {
    padding: 10px;
}

.details-stack {
    display: grid;
    gap: 10px;
}

.details-stack .matrix-section {
    margin: 0;
}

.results-cell {
    max-width: 360px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.row-head {
    min-width: 180px;
}

.results-details-sections {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.matrix-section {
    padding: 6px;
}

.matrix-section.wg-cell {
    line-height: normal;
}

.matrix-section summary {
    cursor: pointer;
    margin-bottom: 6px;
}

.matrix-scroll {
    overflow: auto;
}

.matrix-table {
    width: 100%;
}

.matrix-table th,
.matrix-table td {
    min-width: 200px;
    vertical-align: top;
}

.settings-table th,
.settings-table td {
    min-width: 0;
    width: 33.33%;
}

.settings-label {
    margin-bottom: 4px;
}

.cell-stack {
    display: grid;
    gap: 2px;
}

.result-summary {
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.result-meta {
    margin-bottom: 6px;
}

.result-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px 8px;
}

.kpi {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 6px;
}

.result-details {
    display: grid;
    gap: 8px;
}

.detail-group {
    padding: 6px;
}

.detail-title {
    margin-bottom: 4px;
}

.detail-sub {
    margin-top: 4px;
}

.detail-pills {
    display: flex;
    flex-wrap: wrap;
}

.buildings-table {
    width: 100%;
    margin-top: 4px;
}

.buildings-table th,
.buildings-table td {
    vertical-align: top;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 1000;
}

.modal {
    width: min(800px, 96vw);
    max-height: 90vh;
    overflow: auto;
    padding: 10px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.modal-title {
    margin: 0;
}

.modal-body {
    display: grid;
    gap: 10px;
}

body.modal-open {
    overflow: hidden;
}

#resultsTableColumns th.col-head {
    cursor: pointer;
}

#resultsTableColumns {
    table-layout: fixed;
}

#resultsTableColumns .row-head {
    width: 200px;
    max-width: 200px;
}

.modal .matrix-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.modal .matrix-table th,
.modal .matrix-table td {
    min-width: 0;
}

.edit-form-table th,
.edit-form-table td {
    vertical-align: top !important;
}

.modal-section-title {
    margin: 0 0 4px;
}

.mini-table {
    width: 100%;
    margin-top: 4px;
}

.mini-table td {
    vertical-align: top;
}

.pill {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
}

.ufo-accent {
    color: #4fe7ff !important;
}

label.ufo-accent input[type="checkbox"] {
    accent-color: #4fe7ff;
}

td.ufo-accent input[type="checkbox"] {
    accent-color: #4fe7ff;
}

.status {
    display: inline-block;
}

.import-area {
    margin-top: 6px;
}

.import-textarea {
    width: 100%;
}

.is-hidden {
    display: none;
}

.detail-block {
    min-width: 220px;
}

.detail-section {
    margin-top: 6px;
}

.plus {
    padding: 0 !important;
}
.minus {
    padding: 0 !important;
}

.hover-tooltip-wrap {
    display: inline-block;
    cursor: help;
    max-width: 100%;
}

.floating-tooltip {
    position: fixed;
    z-index: 100000;
    min-width: 240px;
    max-width: min(420px, calc(100vw - 24px));
    padding: 1px;
    color: #fff;
    pointer-events: none;
}

.hover-tooltip-table {
    border-collapse: collapse;
    table-layout: fixed;
}

.hover-tooltip-table td {
    padding: 2px 4px;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    border: 1px solid #3a3a3a;
    background: #232323;
}

.hover-tooltip-table td:first-child {
    color: #bdbdbd;
}

.hover-tooltip-table td.plus {
    padding: 4px 5px !important;
}
.hover-tooltip-table small {
    color: #98ccff;
}

.hover-tooltip-table th {
    padding: 2px 4px;
    border: 1px solid #3a3a3a;
    background: #1f1f1f;
    text-align: left;
    color: #d8d8d8;
}

.hover-tooltip-table.hover-tooltip-table-split td:first-child,
.hover-tooltip-table.hover-tooltip-table-split th:first-child {
    width: 46%;
}

input[type="number"], input[type="text"], select, textarea {
    width: 95px;
}

textarea {
    margin: 0 0px; 
    padding: 0px 0px;
}

label {
        color: #98CCFF;
}

[data-edit-import-panel] textarea[data-edit-import-text] {
    width: 100%;
    box-sizing: border-box;
}

[data-edit-import-panel] .actions-top-small {
    justify-content: center;
}
