body,html{
    height:100%;
    width:100%;
    padding:0;
    margin:0;
}

textarea {
    box-sizing: border-box;
    resize: vertical;
    overflow-y: auto;
}

header{
    border:1px solid grey;
    height: 40px;
    display: none;
}

ul.unstyled {
	list-style: none;
}

#domainstabs {
    display: none;
}

footer .footer-tab-btn {
    padding: 5px;
    border:1px solid grey;
    margin: 0 0 0 15px;
    background-color: white;
    color: inherit;
    font: inherit;
}

footer {
    height: 40px;
}

.tab-pane .tags:nth-child(2){
    overflow: scroll;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

#tags-controls {
    overflow: visible;
}

#tags-panels-container {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap !important;
}

#complex-mode-panel {
    margin-top: 10px;
    margin-bottom: 0;
    background: #fff;
    flex: 0 0 auto;
    overflow-y: auto;
}

#tags-sections-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.tag-list-section {
    margin-bottom: 12px;
}

.tag-list-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tag-list-section-header h3 {
    font-size: 16px;
    margin: 0;
}

.tag-list-toggle {
    margin: 0;
    font-weight: normal;
}

@media (min-width: 992px) {
    #tags-panels-container {
        flex-direction: row !important;
        align-items: stretch;
        gap: 16px;
    }

    #tags-sections-scroll {
        flex: 1 1 auto;
        height: 100%;
    }

    #complex-mode-panel {
        flex: 0 0 340px;
        width: 340px;
        margin-top: 0;
        padding-left: 10px;
        border-left: 1px solid #c8c8c8;
        border-top: 0;
    }
}

#tags-list,
#complex-tags-list {
    padding-bottom: 4px;
    column-gap: 14px;
}

#tags-list .onetag,
#complex-tags-list .onetag,
.entity-choice-value-line,
.entity-property-line {
    margin-bottom: 4px;
}

#tags-list .onetag,
#complex-tags-list .onetag {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
}

@media (min-width: 769px) {
    #tags-list,
    #complex-tags-list {
        column-count: 2;
    }
}

@media (min-width: 992px) {
    #tags-list,
    #complex-tags-list {
        column-count: 3;
    }
}

@media (min-width: 1280px) {
    #tags-list,
    #complex-tags-list {
        column-count: 4;
    }
}

@media (min-width: 1600px) {
    #tags-list,
    #complex-tags-list {
        column-count: 5;
    }
}

#infoedit {
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-bottom: 56px;
}

#infoedit .row,
#infolist .row {
    margin-left: 0;
    margin-right: 0;
}

#infoedit .col,
#infolist .col {
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

.match-false {
    visibility: hidden;
}

.match-true {
    color: blue;
}

.even {
    margin: 0 0 5px 0;
    border-left: 3px solid #f4f4f4;
    padding-left: 5px;
}


.odd {
    background-color: rgb(200, 200, 200);
    margin: 0 0 5px 0;
    border-left: 3px solid rgb(200, 200, 200);
    padding-left: 5px;
}

.infoelem.current {
    border-left: 3px solid var(--tg-select);
}

.tag-settings-block {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #c8c8c8;
}

.tag-settings-block h3 {
    font-size: 16px;
    margin: 0 0 6px 0;
}

.tag-settings-note {
    color: #555;
    margin: 4px 0 0 0;
}

.info-context-panel {
    min-height: 22px;
    margin: 0 0 2px 0;
    color: #333;
}

.info-context-title {
    font-weight: bold;
}

.tag-settings-row {
    margin: 0 0 6px 0;
}

.tag-settings-row label {
    display: block;
    margin-bottom: 3px;
}

.tag-settings-row input[type="text"],
.tag-settings-row input[type="number"],
.tag-settings-row input[type="date"],
.tag-settings-row select,
.tag-settings-row textarea {
    width: 100%;
    max-width: 100%;
}

.tag-property-list {
    list-style: none;
    padding-left: 0;
    margin: 6px 0;
}

.tag-property-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.tag-property-label {
    flex: 1 1 auto;
    min-width: 150px;
}

.complex-property-add-row select {
    max-width: 100%;
}

.info-editor-mode {
    margin: 4px 0;
    font-weight: bold;
}

.info-list-actions {
    clear: both;
    min-height: 40px;
    padding: 6px 0;
}

#infolist > .row,
#infolist > .row > .col {
    height: 100%;
    min-height: 0;
}

#infolist > .row > .col {
    display: flex;
    flex-direction: column;
}

.info-list-header {
    flex: 0 0 auto;
    min-height: 96px;
}

#infolist-items {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    overflow: auto;
}

.info-list-actions {
    flex: 0 0 auto;
}

.entity-view-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.entity-view-controls select {
    max-width: min(360px, 70vw);
}

.entity-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    margin: 4px 0 8px 0;
}

.entity-widget-card {
    border: 1px solid #aaa;
    background: #fff;
    padding: 6px 8px;
    min-width: 0;
}

.entity-widget-card-wide {
    grid-column: span 2;
}

.entity-widget-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.entity-widget-value {
    font-size: 22px;
    line-height: 1.2;
}

.entity-widget-note {
    color: #555;
    font-size: 12px;
    margin-top: 4px;
}

.entity-widget-groups {
    max-height: 220px;
    overflow: auto;
}

.entity-widget-group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: baseline;
    padding: 2px 0;
    border-bottom: 1px solid #eee;
}

.entity-widget-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #d8e1e6;
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.entity-widget-group-row span {
    overflow-wrap: anywhere;
}

.entity-widget-group-row small {
    color: #555;
}

.entity-widget-with-plan {
    overflow-x: auto;
}

.entity-widget-with-plan .entity-widget-group-head,
.entity-widget-with-plan .entity-widget-group-row {
    width: 820px;
    min-width: 680px;
    max-width: 100%;
    grid-template-columns: minmax(180px, 1fr) 130px 140px 120px 70px;
}

.entity-widget-with-plan .entity-widget-groups {
    width: 820px;
    min-width: 680px;
    max-width: 100%;
    overflow-x: hidden;
}

.entity-widget-group-row.is-over-plan {
    margin: 0 -4px;
    padding: 2px 4px;
    border-left: 3px solid var(--tg-danger);
    background: #fff0ee;
    color: var(--tg-danger);
}

.entity-widget-plan-control[hidden] {
    display: none !important;
}

.entity-widget-empty {
    color: #555;
}

.entity-table-wrapper {
    min-width: 100%;
    overflow-x: auto;
}

.entity-table-toolbar {
    position: sticky;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    white-space: nowrap;
}

.export-entity-csv-btn {
    margin-left: auto;
}

.entity-data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.entity-data-table th,
.entity-data-table td {
    min-width: 130px;
    max-width: 360px;
    padding: 4px 6px;
    border: 1px solid #aaa;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.entity-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f4f4f4;
}

.entity-data-table .entity-table-filter-row th {
    top: 31px;
}

.entity-table-sort-btn {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

.entity-table-filter {
    width: 100%;
    min-width: 120px;
    box-sizing: border-box;
    font-weight: normal;
}

.entity-cell-edit-wrap {
    position: relative;
    min-height: 28px;
}

.entity-data-table .entity-cell-editor {
    width: 100%;
    min-width: 110px;
    min-height: 28px;
    padding: 2px 4px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.35;
    box-shadow: none;
}

.entity-data-table .entity-cell-editor:hover,
.entity-data-table .entity-cell-editor:focus,
.entity-data-table .entity-cell-editor:focus-visible {
    border-color: #557f96;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(85, 127, 150, 0.16);
}

.entity-data-table select.entity-cell-editor {
    appearance: none;
    background-image: none;
    cursor: pointer;
}

.entity-data-table select.entity-cell-editor:hover,
.entity-data-table select.entity-cell-editor:focus,
.entity-data-table select.entity-cell-editor:focus-visible {
    appearance: auto;
}

.entity-data-table input[type="date"].entity-cell-editor::-webkit-calendar-picker-indicator {
    opacity: 0;
}

.entity-data-table input[type="date"].entity-cell-editor:hover::-webkit-calendar-picker-indicator,
.entity-data-table input[type="date"].entity-cell-editor:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
}

.entity-cell-textarea {
    min-height: 28px;
    resize: vertical;
}

.entity-cell-readonly-text {
    min-height: 26px;
    color: #555;
}

.entity-cell-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.entity-cell-edit-wrap.is-changed .entity-cell-editor {
    border-color: #b98b2d;
    background: #fff8e7;
}

.entity-cell-edit-wrap.is-saving .entity-cell-editor {
    border-color: #557f96;
    background: #edf5f8;
}

.entity-cell-edit-wrap.is-saved .entity-cell-editor {
    border-color: #6e9a7b;
    background: #edf7ef;
}

.entity-cell-edit-wrap.is-error .entity-cell-editor {
    border-color: #b44d4d;
    background: #fff1f1;
}

.entity-data-table tbody tr.infoelem {
    cursor: pointer;
}

.entity-data-table tbody tr:nth-child(odd) {
    background: rgb(235, 235, 235);
}

.entity-data-table tbody tr.infoelem.current {
    border-left: 3px solid var(--tg-select);
}

.entity-data-table tfoot td {
    background: #f4f4f4;
}

.entity-cell-bold {
    font-weight: bold;
}

.entity-cell-deadline-warning {
    color: #b00020;
    font-weight: bold;
}

.entity-table-empty {
    color: #555;
    text-align: center !important;
}

.entity-view-settings-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #999;
}

.entity-view-fieldset {
    margin: 8px 0;
    padding: 6px;
    border: 1px solid #aaa;
}

.entity-view-fieldset legend {
    width: auto;
    margin: 0;
    padding: 0 4px;
    font-size: 14px;
}

.entity-view-option {
    display: inline-block;
    margin: 2px 12px 2px 0;
    font-weight: normal;
}

.entity-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.entity-widget-settings-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 6px;
    align-items: end;
    margin: 6px 0;
    padding: 6px;
    border: 1px solid #d0d0d0;
}

.entity-widget-settings-row .tag-settings-row {
    margin: 0;
}

.entity-view-actions {
    margin-top: 8px;
}

.tag-type-badge {
    color: #666;
    font-size: 12px;
    margin-left: 6px;
}

.typed-group {
    margin-bottom: 10px;
}

.typed-group-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.typed-rich-toolbar {
    display: flex;
    gap: 4px;
    margin: 0 0 4px 0;
}

.typed-rich-editor {
    border: 1px solid #777;
    min-height: 120px;
    padding: 6px;
    background: #fff;
}

.typed-file-list {
    margin: 4px 0;
    padding-left: 18px;
}

.editor-coords-panel {
    margin: 6px 0;
    padding: 4px 6px;
    border: 1px solid #c8c8c8;
    background: #fff;
}

.editor-coords-title {
    font-weight: bold;
}

.cloud-files-list {
    margin-top: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.standard-file-drop-zone {
    border: 1px dashed #999;
    padding: 8px;
    background: #fff;
}

.standard-file-drop-zone.is-dragover {
    background: #f2f2f2;
}

.standard-file-drop-zone input[type="file"] {
    display: block;
    margin-top: 6px;
}

.standard-file-remove-label {
    color: #555;
    font-size: 12px;
}

.typed-file-remove-label {
    color: #555;
    font-size: 12px;
}

.coord-choice-picker {
    border: 1px solid #c8c8c8;
    padding: 8px;
    background: #fff;
}

.coord-choice-current {
    margin-bottom: 6px;
}

.coord-choice-current-title {
    font-weight: bold;
}

.coord-choice-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.coord-choice-search {
    flex: 1 1 auto;
    min-width: 0;
}

.coord-choice-list {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    border-top: 1px solid #e0e0e0;
    padding-top: 6px;
}

.coord-choice-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 3px 6px;
    margin-bottom: 4px;
    border: 1px solid ButtonBorder;
    background: ButtonFace;
}

.coord-choice-option.is-selected {
    font-weight: bold;
}

.main-editor-textarea {
    width: 100%;
    max-width: 100%;
    min-height: 160px;
    box-sizing: border-box;
}

textarea.typed-value-field[data-type="textarea"] {
    min-height: 120px;
}

input.btn-primary,
button.btn-primary,
.btn-primary {
    color: ButtonText !important;
    background: ButtonFace !important;
    border: 1px solid ButtonBorder !important;
    border-radius: 2px !important;
    padding: 1px 6px !important;
    line-height: normal !important;
    box-shadow: none !important;
}

input.btn-primary:hover,
button.btn-primary:hover,
.btn-primary:hover,
input.btn-primary:focus,
button.btn-primary:focus,
.btn-primary:focus,
input.btn-primary:active,
button.btn-primary:active,
.btn-primary:active {
    color: ButtonText !important;
    background: ButtonFace !important;
    border-color: ButtonBorder !important;
    box-shadow: none !important;
}

input.btn-primary:not(:disabled):active,
button.btn-primary:not(:disabled):active,
.btn-primary:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

input.btn-primary:disabled,
button.btn-primary:disabled,
.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#add-field-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
}

#add-field-form > * {
    margin: 0;
}

#field-name-input {
    flex: 0 1 230px;
}

#field-description-input {
    flex: 0 1 230px;
    min-height: 72px;
}

@media (max-width: 768px) {
    .entity-view-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .entity-widgets-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .entity-widget-card-wide {
        grid-column: auto;
    }

    .entity-widget-settings-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .entity-data-table th,
    .entity-data-table td {
        min-width: 150px;
        max-width: 260px;
    }

    .entity-view-controls select {
        max-width: calc(100vw - 150px);
    }

    #tags-sections-scroll {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        overflow-x: auto;
        overflow-y: hidden;
    }

    #tags-sections-scroll .tag-list-section {
        min-height: 0;
    }

    #tags-sections-scroll .tag-list-section:nth-child(2) {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    #complex-tags-list,
    #tags-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 66.666vw;
        column-count: initial;
        column-gap: 0;
        gap: 2px 4px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #complex-tags-list {
        grid-template-rows: 26px;
        min-height: 26px;
        max-height: 26px;
    }

    #tags-list {
        flex: 1 1 auto;
        grid-template-rows: repeat(auto-fill, 26px);
        height: auto;
        min-height: 0;
        max-height: none;
    }

    #tags-list .onetag,
    #complex-tags-list .onetag {
        display: block;
        width: auto;
        margin: 0;
        padding-right: 6px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    #add-field-form {
        flex-direction: column;
        align-items: stretch;
    }

    #field-name-input,
    #field-description-input {
        flex: 1 1 auto;
        width: 100% !important;
    }

    #add-field-form .btn-primary {
        align-self: flex-start;
    }
}

:root {
    --tg-bg: #f4f7f8;
    --tg-panel: #ffffff;
    --tg-panel-soft: #f9fbfc;
    --tg-text: #17212b;
    --tg-muted: #5f6f7d;
    --tg-line: #cfd9e0;
    --tg-line-strong: #9cafbd;
    --tg-accent: #0b6fa4;
    --tg-accent-soft: #e8f3f8;
    --tg-success-soft: #eef7f1;
    --tg-danger: #a1272c;
    --tg-select: #17466f;
    --tg-select-soft: #e7f0f8;
    --tg-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
}

body,
html {
    background: var(--tg-bg);
    color: var(--tg-text);
}

body {
    -webkit-tap-highlight-color: rgba(11, 111, 164, 0.18);
}

a {
    color: #006bb8;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: #004f88;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(11, 111, 164, 0.65);
    outline-offset: 2px;
}

#main-shell {
    min-height: 100%;
    padding: 8px 10px 96px;
    box-sizing: border-box;
}

#domainstabs + .tab-content {
    height: calc(100vh - 104px) !important;
    overflow: hidden;
}

#domains,
#tags,
#infolist,
#infoedit {
    background: var(--tg-panel);
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    box-shadow: var(--tg-shadow);
    padding: 10px 12px;
    max-height: 100%;
    overflow-y: auto;
}

#domains h2,
#tags h2,
#infolist h2,
#infoedit h2 {
    margin: 0 0 8px;
    color: var(--tg-text);
    letter-spacing: -0.01em;
    text-wrap: balance;
}

#tags-controls {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tg-line);
}

#tags-panels-container {
    padding-top: 10px;
}

.tag-list-section {
    padding: 8px;
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: var(--tg-panel-soft);
}

.tag-list-section-header {
    padding-bottom: 5px;
    border-bottom: 1px solid var(--tg-line);
}

.tag-list-section-header h3 {
    color: var(--tg-text);
    font-weight: 700;
}

.tag-list-toggle,
.tag-settings-note,
.entity-widget-note,
.standard-file-remove-label,
.typed-file-remove-label {
    color: var(--tg-muted);
}

#complex-mode-panel,
.tag-settings-block,
.editor-coords-panel,
.coord-choice-picker,
.standard-file-drop-zone {
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: var(--tg-panel);
    padding: 8px;
}

.tag-settings-block {
    border-top: 1px solid var(--tg-line);
}

.tag-settings-block h3 {
    color: var(--tg-text);
}

#tags-list .onetag,
#complex-tags-list .onetag {
    padding: 1px 2px;
}

#tags-list label.checkbox,
#complex-tags-list label.checkbox {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    margin: 0;
    padding: 2px 5px;
    border-radius: 5px;
    cursor: pointer;
}

#tags-list label.checkbox:hover,
#complex-tags-list label.checkbox:hover {
    background: var(--tg-accent-soft);
}

#tags-list input[type="checkbox"],
#complex-tags-list input[type="checkbox"],
.entity-view-option input[type="checkbox"],
.tag-list-toggle input[type="checkbox"] {
    margin-right: 4px;
}

.done-true,
.complex-tag input:checked + span {
    font-weight: 700;
}

#complex-tags-list input:checked + span,
#tags-list input:checked + span {
    color: #0b4f2f;
}

.tag-type-badge {
    color: var(--tg-muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea,
.typed-rich-editor {
    border: 1px solid var(--tg-line-strong);
    border-radius: 6px;
    background-color: #fff;
    color: var(--tg-text);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    min-height: 30px;
    padding: 4px 8px;
    box-sizing: border-box;
}

textarea,
.typed-rich-editor {
    line-height: 1.35;
}

.main-editor-textarea,
textarea.typed-value-field[data-type="textarea"] {
    border-color: #8799a8;
    box-shadow: inset 0 1px 2px rgba(23, 33, 43, 0.06);
}

input.btn-primary,
button.btn-primary,
.btn-primary {
    min-height: 30px;
    color: var(--tg-text) !important;
    background: linear-gradient(#ffffff, #eef3f6) !important;
    border: 1px solid var(--tg-line-strong) !important;
    border-radius: 5px !important;
    padding: 4px 10px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    line-height: 20px !important;
}

input.btn-primary:hover,
button.btn-primary:hover,
.btn-primary:hover {
    background: var(--tg-accent-soft) !important;
    border-color: var(--tg-accent) !important;
}

input.btn-primary:not(:disabled):active,
button.btn-primary:not(:disabled):active,
.btn-primary:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 2px rgba(23, 33, 43, 0.28) !important;
}

.info-list-header {
    min-height: 88px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tg-line);
}

.info-context-panel,
.info-editor-mode {
    color: var(--tg-text);
}

.entity-view-controls {
    padding: 6px 8px;
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: var(--tg-panel-soft);
}

.entity-widgets-grid {
    gap: 10px;
}

.entity-widget-card {
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fafb 100%);
    box-shadow: var(--tg-shadow);
}

.entity-widget-value {
    color: var(--tg-accent);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.entity-widget-group-row {
    border-bottom: 1px solid #e5ecef;
    font-variant-numeric: tabular-nums;
}

.entity-widget-group-head {
    border-bottom-color: #cfdce2;
    color: var(--tg-muted);
    font-variant-numeric: tabular-nums;
}

.entity-table-wrapper {
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: #fff;
}

.entity-table-toolbar {
    padding: 6px 8px;
    border-bottom: 1px solid var(--tg-line);
    background: var(--tg-panel-soft);
}

.entity-data-table th,
.entity-data-table td {
    border: 1px solid #d8e1e6;
}

.entity-data-table thead th {
    background: #eef4f7;
}

.entity-data-table tbody tr:nth-child(odd) {
    background: #f6f9fa;
}

.entity-data-table tbody tr.infoelem:hover {
    background: var(--tg-accent-soft);
}

.entity-data-table tbody tr.infoelem.current {
    border-left: 3px solid var(--tg-select);
    background: var(--tg-select-soft);
    box-shadow: inset 2px 0 0 var(--tg-select);
}

.entity-data-table tfoot td {
    background: #eef4f7;
    font-variant-numeric: tabular-nums;
}

.entity-cell-deadline-warning {
    color: var(--tg-danger);
}

.entity-view-settings-block,
.entity-view-fieldset,
.entity-widget-settings-row {
    border-color: var(--tg-line);
    border-radius: 8px;
    background: var(--tg-panel-soft);
}

#add-field-form {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(220px, 360px) auto;
    gap: 8px;
    align-items: start;
    max-width: 980px;
}

#add-field-form > * {
    margin: 0;
}

#field-name-input {
    width: 100% !important;
    min-width: 0;
    height: 34px;
    line-height: 22px;
}

#field-description-input {
    width: 100% !important;
    min-width: 0;
    min-height: 34px;
    max-height: 92px;
}

#add-field-form input[type="submit"] {
    width: auto !important;
    height: 34px;
    min-height: 34px;
    align-self: start;
    justify-self: start;
    white-space: nowrap;
}

#add-tag-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tag-text-input {
    flex: 1 1 auto;
    min-width: 0;
}

#add-tag-form input[type="submit"] {
    float: none !important;
    flex: 0 0 auto;
}

.info-list-actions {
    padding: 8px 0 76px;
}

#infolist-items {
    padding-bottom: 20px;
}

#infoedit {
    padding-bottom: 96px;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 12px;
}

.editor-actions .btn-primary {
    min-height: 32px;
}

#typed-fields-panel,
#coordinate-settings-panel,
#info-files-panel,
.typed-group,
.tag-settings-row,
.entity-view-fieldset,
.entity-widget-settings-row {
    box-sizing: border-box;
}

.tag-settings-row {
    align-items: start;
}

.entity-view-actions,
.coord-choice-actions,
.typed-rich-toolbar {
    align-items: center;
}

#add-info-btn,
#update-info-btn,
#delete-info-btn {
    margin-top: 0;
    margin-right: 0;
}

.settings-details {
    margin-top: 8px;
    border: 1px solid var(--tg-line);
    border-radius: 8px;
    background: var(--tg-panel-soft);
    overflow: hidden;
}

.settings-details summary {
    cursor: pointer;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--tg-ink);
    background: rgba(255, 255, 255, 0.7);
    user-select: none;
}

.settings-details summary:hover {
    background: #fff;
}

.settings-details-body {
    padding: 10px;
}

.settings-details-body > h3:first-child {
    display: none;
}

.settings-details .entity-view-settings-block {
    margin-top: 0;
    border: 0;
    background: transparent;
}

.entity-widget-settings-row {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.coord-choice-option {
    border-color: var(--tg-line-strong);
    border-radius: 5px;
    background: #fff;
}

.coord-choice-option:hover,
.coord-choice-option.is-selected {
    background: var(--tg-accent-soft);
}

.standard-file-drop-zone.is-dragover {
    background: var(--tg-accent-soft);
    border-color: var(--tg-accent);
}

footer {
    left: 0;
    right: 0;
    min-height: 46px;
    padding: 7px 8px;
    background: rgba(244, 247, 248, 0.96);
    border-top: 1px solid var(--tg-line);
    z-index: 20;
}

.infoelem.current {
    border-left: 3px solid var(--tg-select);
}

footer .footer-tab-btn {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-color: var(--tg-line-strong);
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
}

footer .footer-tab-btn:hover {
    background: var(--tg-accent-soft);
}

#app-status-line {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    border: 1px solid var(--tg-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #42525a;
    font-size: 12px;
    line-height: 1.2;
    pointer-events: auto;
    white-space: nowrap;
}

#app-unsaved-indicator {
    display: none !important;
}

#app-status-line.has-unsaved-changes {
    border-color: #c2382a;
    background: #fff0ee;
    color: #8f241a;
    box-shadow: 0 0 0 2px rgba(194, 56, 42, 0.12);
}

#app-status-line a {
    color: inherit;
    text-decoration: none;
}

#app-status-line a:hover {
    text-decoration: underline;
}

@media (min-width: 992px) {
    #complex-mode-panel {
        background: var(--tg-panel-soft);
    }
}

@media (max-width: 768px) {
    #main-shell {
        padding: 6px 6px 96px;
    }

    #app-status-line {
        bottom: 56px;
        max-width: calc(100vw - 24px);
    }

    footer[style*="display: none"] + #app-status-line,
    footer[style*="display:none"] + #app-status-line {
        bottom: 10px;
    }

    #domains,
    #tags,
    #infolist,
    #infoedit {
        padding: 8px;
        border-radius: 7px;
    }

    .tag-list-section {
        padding: 6px;
    }

    #tags-list label.checkbox,
    #complex-tags-list label.checkbox {
        width: 100%;
    }

    #add-field-form {
        grid-template-columns: minmax(0, 1fr);
        max-width: none;
    }

    #add-field-form input[type="submit"] {
        justify-self: start;
    }

    #add-tag-form {
        flex-wrap: wrap;
    }

    #add-tag-form input[type="submit"] {
        margin-left: auto;
    }
}

#domains,
#tags,
#infolist,
#infoedit {
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

#tags.active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

#tags-controls {
    flex: 0 0 auto;
}

#tags-panels-container {
    flex: 1 1 auto;
    min-height: 0;
}

#infolist {
    overflow: hidden;
}

#domains table {
    table-layout: fixed;
}

#domains td,
#cloud-status,
.cloud-files-list {
    min-width: 0;
    overflow-wrap: anywhere;
}

.standard-file-drop-zone input[type="file"],
.typed-file-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

button,
input[type="button"],
input[type="submit"] {
    touch-action: manipulation;
}

.entity-cell-format-bold .entity-cell-editor,
.entity-cell-format-bold .entity-cell-readonly-text {
    font-weight: 700;
}

.entity-cell-format-underline .entity-cell-editor,
.entity-cell-format-underline .entity-cell-readonly-text {
    text-decoration-line: underline;
}

.entity-cell-format-strike .entity-cell-editor,
.entity-cell-format-strike .entity-cell-readonly-text {
    text-decoration-line: line-through;
}

.entity-cell-format-underline.entity-cell-format-strike .entity-cell-editor,
.entity-cell-format-underline.entity-cell-format-strike .entity-cell-readonly-text {
    text-decoration-line: underline line-through;
}

.entity-cell-format-menu {
    position: fixed;
    z-index: 1000;
    display: grid;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--tg-line-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 43, 0.22);
    overscroll-behavior: contain;
}

.entity-cell-format-menu[hidden] {
    display: none;
}

.entity-cell-format-menu-title {
    padding: 4px 8px 7px;
    color: var(--tg-muted);
    font-size: 12px;
    font-weight: 600;
}

.entity-cell-format-menu button {
    min-height: 34px;
    padding: 5px 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--tg-text);
    text-align: left;
}

.entity-cell-format-menu button:hover,
.entity-cell-format-menu button:focus-visible {
    background: var(--tg-accent-soft);
}

.entity-cell-format-menu button.is-active {
    background: var(--tg-select-soft);
    color: var(--tg-select);
}

.entity-cell-format-menu button.is-active::after {
    float: right;
    content: "✓";
}

.entity-cell-format-menu button:disabled {
    color: var(--tg-muted);
    opacity: 0.55;
}

.entity-data-table td[data-column-key] {
    touch-action: pan-x pan-y;
}

@media (max-width: 768px) {
    #main-shell {
        padding: 6px 6px 96px;
    }

    #main-shell > .row > .col {
        padding-right: 0;
        padding-left: 0;
    }

    #domainstabs + .tab-content {
        height: calc(100vh - 104px) !important;
        height: calc(100dvh - 104px) !important;
    }

    #domains,
    #tags,
    #infolist,
    #infoedit {
        width: 100%;
    }

    #domains h2,
    #tags h2,
    #infolist h2,
    #infoedit h2 {
        font-size: 27px;
        line-height: 1.12;
    }

    #domains .tags {
        min-width: 0;
    }

    #cloud-status,
    .cloud-files-list {
        word-break: break-word;
    }

    #tags-controls {
        padding-bottom: 8px;
    }

    #add-tag-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        align-items: center;
    }

    #tag-text-input {
        width: 100% !important;
    }

    #add-tag-form input[type="submit"] {
        width: auto;
        margin-left: 0;
    }

    #tags-panels-container {
        padding-top: 6px;
    }

    #tags-sections-scroll {
        overflow-x: hidden;
        overflow-y: hidden;
    }

    #complex-tags-list,
    #tags-list {
        grid-auto-columns: 66.666%;
    }

    #complex-mode-panel {
        max-height: 112px;
        margin-top: 6px;
    }

    .info-list-header {
        min-height: 0;
        padding-bottom: 6px;
    }

    .entity-view-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px;
    }

    .entity-view-controls > label {
        grid-column: 1 / -1;
    }

    .entity-view-controls select {
        width: 100%;
        max-width: none;
    }

    #infolist-items {
        padding-bottom: 6px;
    }

    .entity-widgets-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(245px, 86%);
        align-items: start;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        padding-bottom: 4px;
    }

    .entity-widget-card,
    .entity-widget-card-wide {
        grid-column: auto;
        scroll-snap-align: start;
    }

    .entity-widget-groups {
        max-height: 170px;
    }

    .entity-table-toolbar {
        white-space: normal;
    }

    .entity-table-toolbar .tag-settings-note {
        flex: 1 1 120px;
    }

    .export-entity-csv-btn {
        margin-left: 0;
    }

    .info-list-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-height: 0;
        padding: 6px 0 4px;
    }

    .info-list-actions .btn-primary {
        flex: 1 1 140px;
        margin: 0;
    }

    #infoedit {
        padding-bottom: 12px;
    }

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

    .editor-actions .btn-primary {
        width: 100%;
    }

    footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding-right: max(8px, env(safe-area-inset-right));
        padding-bottom: max(7px, env(safe-area-inset-bottom));
        padding-left: max(8px, env(safe-area-inset-left));
    }

    footer .footer-tab-btn {
        margin: 0;
    }

    #app-status-line {
        justify-content: center;
        gap: 6px;
        width: max-content;
        max-width: calc(100vw - 16px);
        white-space: normal;
        text-align: center;
    }

    .entity-cell-format-menu {
        width: min(230px, calc(100vw - 16px));
        min-width: 0;
    }
}
