:root {
    --font-size: 17px;
    --bg-page-head: #006061;
    --bg-wash: #efe6e6;
    --bg-central-form-backdrop: #a0a0a0;
    --panel-border: #a3aba3;
    --panel-border-radius: 0.4em;
    --main-margin: 0.5em;
    --field-border-color: #d9d9d9;
    --input-text-color: #1b1b1b;
    --bg-gradient: #669FA0;
    --nav-menu-bg: #e9e9e9;
    --nav-menu-select: #669FA0;
    --nav-link: var(--bg-page-head);
    --popup-nav-link: #fff;
    --bg-unwash: #fff;
    --bg-error: crimson;
    --fg-error: #fff;
    --fg-login-header: #03314f;
    --fg-titlebar: black;
    --fg-label: #080e1b;
    --fg-label-disabled: #888;
    --fg-input-error: #740007;
    --bg-input-error: #ffadad;
    --bg-button: #006061;
    --fg-button: white;
    --bg-button-disabled: lightgray;
    --fg-button-disabled: gray;
    --bg-button-hover: #669FA0;
    --bg-button-primary: #187443;
    --bg-button-primary-hover: #1a8b4f;
    --bg-button-delete: #ff5a5b;
    --fg-dlg-titlebar: white;
    --bg-button-cancel: #F4F6F8;
    --fg-button-cancel: #323436;
    --bg-button-cancel-hover: #ECF2F6;
    --fg-button-cancel-hover: #202426;
    --bg-preloader: #eee;
    --fg-tree: #6D6D6D;
    --fg-tree-error: crimson;
    --bg-clickable-hover: lightsteelblue;
    --bg-tree-selected: lightsteelblue;
    --fg-tree-selected: #0d0d0d;
    --bg-trpview: #aaa;
    --border-trpview-page: gray;
    --shadow-trpview-page: #6d6d6d;
    --fg-trpview-field: #051394;
    --bg-listbox-hover: #ccc;
    --fg-metadoc: #465298;
    --fg-grid-head: #666;
    --border-xl: #ccc;
    --shadow-dlg: #ccc;
    --fg-red-warning: #740007;
    --page-head-height: 2.8em;
    --bg-sticky-header: #ffffff;
}

* {
    margin: 0;
    box-sizing: border-box;
}

html,
body,
table,
input,
select,
textarea,
button,
select {
    font-family: "Figtree", Arial, Helvetica, sans-serif;
    font-size: var(--font-size);
}

html,
body {
    height: 100%;
}

@media screen and (max-width: 1440px) {

    html,
    body,
    table,
    input,
    select,
    textarea,
    button,
    select {
        font-size: 14px;
    }
}

@media screen and (max-width: 1280px) {

    html,
    body,
    table,
    input,
    select,
    textarea,
    button,
    select {
        font-size: 13px;
    }
}

@media screen and (max-width: 1152px) {

    html,
    body,
    table,
    input,
    select,
    textarea,
    button,
    select {
        font-size: 12px;
    }
}

@media screen and (max-width: 1024px) {

    html,
    body,
    table,
    input,
    select,
    textarea,
    button,
    select {
        font-size: 10px;
    }
}

@media screen and (max-width: 800px) {

    html,
    body,
    table,
    input,
    select,
    textarea,
    button,
    select {
        font-size: 8px;
    }
}

h1,
h2,
h3 {
    font-family: "Figtree", Arial, Helvetica, sans-serif;
    padding: 0.3em;
}

h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.3em 0;
}

a {
    text-decoration: none;
    color: var(--nav-link);
}

a,
a:visited {
    color: var(--nav-link);
}

a:hover {
    text-decoration: underline;
}

.popup a,
.popup a:visited {
    color: var(--popup-nav-link);
}

p.line-spaced {
    margin: 0.5em 0;
}

/**
 * syncwait class
 */
.syncwait {
    background-image: url("images/button-waiting.gif");
    background-repeat: no-repeat;
    background-size: 1em;
    background-position-x: left;
    background-position-y: center;
    padding: 0 1em 0 1.5em;
    z-index: 1000;
    position: absolute;
    top: 3em;
    right: 1em;
    height: 1.4em;
    background-color: var(--bg-gradient);
    color: var(--fg-button);
    border: 1px solid var(--bg-gradient);
    border-radius: 5px;
}

/*
 * breadcrumbs
 */
.breadcrumbs {
    font-size: 1em;
    margin-bottom: 1em;
    font-weight: 600;
}

.breadcrumbs a {
    margin-left: 1em;
}

/**
 * page header/content
 */
.page-head {
    background-color: var(--bg-page-head);
    height: var(--page-head-height);
    overflow: hidden;
    padding: 0.2em;
}

.page-head img {
    height: 100%;
    padding: 0.2em 0;
    margin-right: 1em;
}

.page-head button {
    background-color: var(--bg-page-head);
}

.page-content {
    background-color: var(--bg-wash);
    position: relative;
    height: calc(100% - var(--page-head-height));
    display: flex;
    flex-flow: column nowrap;
    overflow: hidden;
}

.flex-fill {
    flex: 1 1 auto;
}

.flex-freeze {
    flex-shrink: 0;
    flex-grow: 0;
}

/**
 * context header on top-level form is unwashed
 */
.context-header:not(form form .context-header) {
    background-color: var(--bg-unwash);
    margin: 0 0 var(--main-margin) 0;
    padding: 0.4em;
    border-radius: 0%;
    border: none;
    border-bottom: 1px solid;
}

.form-content {
    display: flex;
    flex-flow: column nowrap;
    flex: 1 1 auto;
    overflow: auto;
}

/** TODO **/
.page-content>form>.con>.con-head>.header {
    background-color: var(--bg-unwash);
    margin: 0 0 var(--main-margin) 0;
    padding: 0.4em;
    border-radius: 0%;
    border: none;
    border-bottom: 1px solid var(--panel-border);
}

/**
 * navmenu
 */
.navmenu {
    border-right: 1px solid var(--panel-border);
    overflow-x: hidden;
    overflow-y: auto;
}

.navmenu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.navmenu li {
    padding: 0.5em;
    overflow: hidden;
    border-left: 4px solid transparent;
}

.navmenu li.select {
    background-color: var(--nav-menu-bg);
    font-weight: 600;
    border-left: 4px solid var(--nav-menu-select);
}

.navmenu li span {
    display: inline-block;
    width: 100%;
    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navmenu li span.error-tag {
    position: absolute;
    right: 1vw;
    min-width: 2em;
    height: 2em;
    text-align: center;
    width: fit-content;
    font-size: 0.75em;
    border-radius: 50%;
    padding: 0.2em;
    background-color: var(--bg-error);
    border: 1px solid var(--bg-error);
    color: var(--fg-error);
}

.buttonbar {
    display: flex;
    flex-flow: row;
}

.button-colors {
    background-color: var(--bg-button);
    color: var(--fg-button);
}

/**
 * login form
 * TODO
 */
.login-backdrop {
    height: 100%;
    width: 100%;
    display: flex;
    background-color: var(--bg-page-head);
    overflow: auto;
}

form.form-login,
form.form-central {
    padding: 1em;
    margin: auto auto;
    height: fit-content;
    background-color: var(--bg-unwash);
    flex: 0 1 auto;
}

form.form-login .buttonbar,
form.form-central .buttonbar {
    justify-content: center;
}

form.form-login button {
    margin: 2em 0 0 0;
    flex-grow: 1;
}

form.form-login p {
    text-align: center;
    margin: 1em 0 0 0;
}

/**
 * banner
 */
form.form-banner img {
    height: 2.4em;
}

/**
 * central form
 */
.central-backdrop {
    height: 100%;
    width: 100%;
    display: flex;
    background-color: var(--bg-central-form-backdrop);
    overflow: auto;
}

.form-central .context-header {
    padding: 0;
}

.form-central button {
    flex-grow: 1;
}

/**
 * action header
 * TODO: extract flex
 */
.action-hdr {
    padding: 0.23em;
    display: flex;
    flex-direction: column;
}

.action-hdr-row {
    vertical-align: baseline;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.action-hdr .hdr-text {
    font-size: 2.2em;
    max-width: 80%;
    text-overflow: ellipsis;
    overflow: hidden;
    text-wrap: nowrap;
}

.action-hdr .hdr-spacer {
    flex-grow: 1;
}

.action-hdr .hdr-buts {
    display: flex;
    background-color: transparent;
    margin-left: 2em;
    flex-direction: row;
    align-items: center;
}

.action-hdr .breadcrumbs {
    font-size: 1.1em;
    margin-bottom: 0.3em;
}

.hdr-but {
    background-color: transparent;
    width: 1.5em;
    min-width: 1.5em;
    height: 2em;
    margin-right: 1em;
}

button.hdr-but span {
    display: block;
    width: 1.5em;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 1.5em;
    background-position-x: center;
    background-position-y: center;
    cursor: pointer;
}

.hdr-but.but-delete span {
    background-image: url("images/btn-delete.svg");
}

.hdr-but.but-taxreturn span {
    background-image: url("images/tax-return.svg");
    background-size: 1.3em;
}

.hdr-but.but-locked span {
    background-image: url("images/locked.svg");
}

.hdr-but.but-unlocked span {
    background-image: url("images/unlocked.svg");
}


.hdr-but:hover {
    transform: scale(1.1);
    background-color: transparent;
}

button.rform-delete:hover {
    transform: scale(1.1);
}

/**
 * titlebar
 */
.titlebar {
    color: var(--fg-titlebar);
    font-size: 1.7em;
    padding: 0.2em;
    margin-bottom: 0.2em;
}

.dlg-title .titlebar {
    color: var(--bg-unwash);
}

.titlebar span {
    max-width: 80%;
    text-overflow: ellipsis;
    overflow: hidden;
    text-wrap: nowrap;
}

.titlebar button {
    float: right;
}

/**
 * input form layout
 */
form h2 {
    background-color: var(--bg-gradient);
    color: var(--fg-error);
}

form p {
    margin: 1em 0;
}

form p+p {
    margin-top: 0;
}

form .field+.buttonbar {
    margin-top: 1em;
}

.form-panel .buttonbar {
    padding: 0.5em;
}

form p:first-child {
    margin-top: 0.4em;
}

.unwash {
    background-color: var(--bg-unwash);
    margin: var(--main-margin) var(--main-margin) 0 var(--main-margin);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-border-radius);
}

.dock-container {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
}

.dock-left {
    flex: 0 0 20%;
    display: flex;
    flex-flow: column nowrap;
    padding-right: 0.2vw;
    overflow: hidden;
}

.dock-right {
    flex: 1 1 auto;
    display: flex;
    flex-flow: column nowrap;
    overflow: hidden;
}

.form-panel {
    display: flex;
    flex-flow: column nowrap;
}

.form-panel h3 {
    margin-top: 0.5em;
    margin-bottom: 1em;
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
}

.form-panel:first-child h3 {
    margin-top: 0.2em;
}

.form-panel.collapsed {
    display: none;
}

.form-panel>p {
    margin: 0 0.5em;
    padding: 0.2em;
}

.form-panel>p:last-of-type {
    margin-bottom: 0.5em;
}

.form-panel>button {
    margin: 0.5em;
}

.field {
    margin: 0.4em 0;
    display: flex;
    justify-content: flex-end;
}

.field .label,
.row .label {
    font-weight: 600;
    line-height: 2;
    color: var(--fg-label);
    flex-grow: 0;
    text-align: right;
    padding-right: 1em;
}

.row .column-header {
    width: 21em;
    font-weight: 700;
    line-height: 2.4;
    color: var(--fg-label);
    flex-grow: 0;
    text-align: center;
}

.field.disabled .label {
    color: var(--fg-label-disabled);
}

input,
select,
textarea {
    padding: 0.4em;
    border-width: 2px;
    border-style: solid;
    border-radius: 0.3em;
    border-color: var(--field-border-color);
    color: var(--input-text-color);
    font-weight: 600;
    width: 18em;
}

.input-sized {
    color: var(--input-text-color);
    font-weight: 600;
    width: 18em;
}

textarea {
    resize: none;
    min-height: 6em;
}

.inputholder {
    height: 2.2em;
    display: flex;
}

input::placeholder {
    opacity: 0.5;
}

textarea:read-only,
input:read-only {
    background-color: var(--field-border-color);
}

input.date {
    width: 16em;
    border-radius: 0 0.3em 0.3em 0;
    height: 100%;
}

.i-date {
    background-color: var(--field-border-color);
    background-image: url("images/i-date.png?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-size: 1em 1em;
    background-position: center center;
    border-color: var(--field-border-color);
    color: var(--fg-label-disabled);
    padding: 0.4em;
    border-width: 2px;
    border-style: solid;
    width: 2em;
    height: 100%;
    display: inline-block;
    padding: 2px;
}

.i-date:hover {
    background-size: 1.1em 1.1em;
}

input.pence,
input.pounds {
    height: 100%;
    text-align: right;
    width: 16em;
    border-radius: 0 0.3em 0.3em 0;
}

input.pounds.narrow {
    width: 10em;
}

.i-pence,
.i-pounds {
    color: var(--fg-label-disabled);
    background-color: var(--field-border-color);
    border-color: var(--field-border-color);
    padding: 0.4em;
    border-width: 2px;
    border-style: solid;
    height: 100%;
    width: 2em;
    display: inline-block;
    font-weight: 700;
    text-align: center;
}

input.number {
    text-align: right;
}

input.error,
select.error {
    border-color: var(--fg-input-error);
    background-color: var(--bg-input-error);
    color: var(--fg-input-error);
}

input[type=checkbox] {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-content: center;
    justify-content: center;
    width: 2.2em;
    height: 2.2em;
    margin-right: 15.8em;
    background-color: var(--bg-unwash);
}

.grid input[type=checkbox] {
    margin-right: 5em;
    margin-left: 5em;
}

input[type="checkbox"][disabled] {
    background-color: var(--field-border-color);
    border-color: var(--field-border-color);
    pointer-events: none;
}

input[type="checkbox"]::before {
    content: "";
    width: 1.2em;
    height: 1.2em;
    clip-path: polygon(28% 38%, 41% 53%, 75% 24%, 86% 38%, 40% 78%, 15% 50%);
    transform: scale(0);
    background-color: var(--input-text-color);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.field .expand {
    width: 2em;
}

.field .infobub {
    width: 2em;
}

.infobub img {
    margin-top: 20%;
    margin-left: 20%;
    width: 60%;
    height: 60%;
}

.infobub img:hover {
    margin-top: 15%;
    margin-left: 15%;
    width: 70%;
    height: 70%;
}

.infobub-popup {
    display: block;
    overflow: auto;
    border: 1px solid var(--fg-label);
    background-color: var(--bg-gradient);
    position: fixed;
    padding: 0.3em;
    max-width: 33vw;
    visibility: hidden;
    z-index: 99;
}

.infobub-popup.infobub-show {
    visibility: visible;
}

.field.waiting .expand {
    background: url("images/field-waiting.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    opacity: 0.7;
}

/** form message */

.form-message div {
    padding: 0.5em 1em;
    align-items: center;
    align-self: stretch;
    border-left: 4px solid var(--fg-input-error);
    background: var(--bg-input-error);
    margin-bottom: 0.5em;
    color: var(--fg-input-error);
    font-family: "Figtree", serif;
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
}

.form-message div:last-of-type {
    margin-bottom: 1em;
}

.lock-message {
    background-color: palegoldenrod;
    padding: 0.5em;
    margin: var(--main-margin);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-border-radius);
}

/** button styles */

button {
    border: none;
    background-color: var(--bg-button);
    color: var(--fg-button);
    padding: 0.3em 0.3em;
    min-width: 8em;
    cursor: pointer;
    margin-right: 0.5em;
}

button.primary {
    background-color: var(--bg-button-primary);
}

button.primary:hover {
    background-color: var(--bg-button-primary-hover);
}

button.delete {
    background-color: var(--bg-button-delete);
}

button:hover {
    background-color: var(--bg-button-hover);
}

button.delete:hover {
    background-color: var(--fg-input-error);
}

button.cancel {
    background-color: var(--bg-button-cancel);
    color: var(--fg-button-cancel);
}

button.cancel:hover {
    background-color: var(--bg-button-cancel-hover);
    color: var(--fg-button-cancel-hover);
}

button:disabled,
button:hover:disabled {
    background-color: var(--bg-button-disabled);
    color: var(--fg-button-disabled);
}

button.waiting {
    opacity: 0.5;
}

button.waiting::after {
    content: "\00a0";
    background: url("images/button-waiting.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    display: inline-block;
    width: 2em;
}

/** utility classes */

.clickable,
.pointer {
    cursor: pointer;
}

.center {
    text-align: center;
}

.clickable:hover {
    background-color: var(--bg-clickable-hover);
}

.hidden {
    display: none !important;
}

.scrollable {
    overflow: auto;
}

.preload {
    background: url("images/preload.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 5em;
    height: 100%;
    width: 100%;
}

.preloader {
    opacity: 0.4;
    background: url("images/preload.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 5em;
    background-color: var(--bg-preloader);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

.filler {
    height: 100%;
    width: 100%;
}

.loading {
    opacity: 0.2;
    min-height: 20vh;
    background: url("images/spinner.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center 5vh;
    background-size: 10vh;
}

/** tab strip **/

ul.tab-strip {
    overflow: auto;
    width: 100%;
    display: table;
    list-style-type: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid lightgray;
    user-select: none;
}

ul.tab-strip>li {
    float: left;
    cursor: pointer;
    position: relative;
    top: 1px;
    padding: 0.4em 0.6em;
}

ul.tab-strip>li:hover {
    color: blue;
}

ul.tab-strip>li.selected {
    border-bottom: 0.3em solid blue;
    font-weight: 700;
}

.tab-content {
    display: flex;
    flex-flow: column nowrap;
    flex: 1 1 auto;
    overflow-y: hidden;
    padding-top: 0.5em;
    padding-left: 0.5em;
}

.tab-content>div {
    overflow-y: hidden;
    display: flex;
    flex-flow: column nowrap;
    flex: 1 1 auto;
}

/**
 * container
 */
.con {
    display: flex;
    flex-flow: column;
    flex: 1 1 auto;
}

.con.unwash {
    height: calc(100% - var(--main-margin));
}

.con .con-head {
    flex: 0 1 auto;
}

.con .con-exp {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-flow: column;
}

.con .con-foot {
    flex: 0 1 1em;
}

/**
 * accordian
 */
.acc {
    display: flex;
    flex-direction: column;
}

.accsec {
    overflow: hidden;
    border-bottom: 1px solid var(--bg-unwash);
    min-height: 3em;
}

.accbar {
    background-color: var(--bg-page-head);
    color: var(--fg-button);
    padding: 1em;
    background-image: url('images/acc-collapse.svg');
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 1em;
}

.accsec.selected .accbar {
    background-image: url('images/acc-expand.svg');
}

.acccon {
    display: none;
    height: fit-content;
    max-height: calc(100% - 3em);
}

.accsec.selected .acccon {
    display: flex;
    flex-flow: column nowrap;
}

/**
 * tree
 */
.tree {
    padding: 1em 0;
    font-size: 0.8em;
    color: var(--fg-tree);
    user-select: none;
    overflow: auto;
}

.tree-node>.clickable {
    padding: 0.2em;
}

.tree-node.selected>.clickable {
    background-color: var(--bg-tree-selected);
    color: var(--fg-tree-selected);
}

.tree-node>.clickable span:first-child {
    padding-left: 1em;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1em;
}

.tree-node.tree-parent>.clickable span:first-child {
    background-image: url('images/vec-down.svg');
}

.tree-node.tree-parent.tree-coll>.clickable span:first-child {
    background-image: url('images/vec-right.svg');
}

.tree-node>.clickable span:last-child {
    padding-left: 1em;
    text-overflow: ellipsis;
    text-wrap: nowrap;
}

.tree-node>.clickable.present span:last-child {
    font-weight: 700;
}

.tree-node>.clickable.errors span:last-child {
    font-weight: 700;
    color: var(--fg-tree-error);
}

.tree-node .tree-content {
    margin-left: 1em;
}

.tree-node.tree-coll .tree-content {
    display: none;
}

/**
 * flex
 */
.flex-row {
    display: flex;
    flex-flow: row;
    overflow: auto;
}

.flex-row.fill {
    flex: 1 1 auto;
}

.flex-column {
    display: flex;
    flex-flow: column;
    overflow: auto;
}

.flex-column img {
    align-self: flex-start;
}

.flex-column.fill {
    flex: 1 1 auto;
}

/**
 * dialog
 */
.dlg-bg {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute;
    background-color: var(--bg-wash);
    opacity: 0.8;
}

.dlg-layer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute;
    background-color: transparent;
    display: grid;
    place-items: center;
}

.dlg-box {
    border: 1px solid var(--bg-page-head);
    background-color: var(--bg-unwash);
    margin: auto auto;
    box-shadow: 1em 1em var(--shadow-dlg);
}

.dlg-titlebar {
    background-color: var(--bg-page-head);
    display: flex;
    flex-direction: row;
    height: 3em;
    color: var(--fg-dlg-titlebar);
    user-select: none;
}

.dlg-title {
    flex-grow: 1;
}

.dlg-title h2 {
    padding: 0.1em 0.4em;
    font-size: 1.2em;
}

.dlg-fixed {
    padding: 0.1em;
    height: 7vh;
    border-bottom: 1px solid gray;
}

.dlg-close {
    float: right;
    margin: 0.2em 0.6em;
    cursor: pointer;
}

.dlg-placeholder {
    padding: 1em;
    overflow: auto;
    min-height: 5vh;
    max-height: 80vh;
    max-width: 100vw;
    display: flex;
}

.dlg-placeholder .preload {
    width: 60vw;
    height: 50vh;
}

/**
 * trp viewer
 */
.trpview {
    position: relative;
    flex-grow: 1;
    background-color: (--bg-trpview);
    padding: 0.2em;
}

.trppages {
    overflow: auto;
    height: 100%;
}

.trppage {
    display: block;
    width: 60vw;
    height: calc(60vw*1.41);
    border: 1px solid var(--border-trpview-page);
    margin: 2vw auto;
    background-size: 60vw;
    background-position: 0 0;
    background-repeat: no-repeat;
    box-shadow: 1em 1em var(--shadow-trpview-page);
    overflow: hidden;
    position: relative;
    font-size: 1vw;
}

.trppage.trp-landscape {
    background-size: calc(60vw);
    width: calc(60vw);
    height: calc(60vw/ 1.41);
    font-size: calc(1vw/1.41);
}

.trpfield {
    position: absolute;
    cursor: pointer;
    font-weight: 600;
    color: var(--fg-trpview-field);
    display: flex;
    align-items: center;
}

.trpfield-wrap {
    align-items: normal;
    flex-direction: column;
}

.trpfield-align-center {
    justify-content: center;
}

.trpfield-align-right {
    justify-content: right;
}

.trpfield:hover {
    background-color: lightgray;
}

.trpfield-comb {
    text-align: center;
    display: inline-block;
}

/**
 * list box styles
 */
.fh {
    height: 100%;
    display: block;
    empty-cells: show;
}

.fh thead {
    height: 2em;
    display: block;
}

.fh th.sortable {
    cursor: pointer;
}

.fh th.sortable span.sortable {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    display: inline-block;
    height: 100%;
    width: 2em;
}

.fh th.sortable:hover {
    background-color: var(--bg-listbox-hover);
}

.fh th.sort-down span.sortable {
    background-image: url('images/sort-down.svg');
}

.fh th.sort-up span.sortable {
    background-image: url('images/sort-up.svg');
}


.fh tbody {
    display: block;
    height: calc(100% - 3em);
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.fh tr {
    display: flex;
    width: 100%;
}

.fh td,
.fh th {
    flex-basis: 100%;
    flex-grow: 2;
    display: block;
    text-align: left;
    padding: 0.4em;
}

.striped tbody tr:nth-child(2n) {
    background-color: rgba(130, 130, 170, 0.1);
}

.striped tbody tr:nth-child(2n):hover {
    background-color: var(--bg-clickable-hover);
}

/**
 * metadoc layout
 */
.metadoc-content {
    flex: 1 0 auto;
    height: 100%;
}

.metadoc-content .section {
    border: 1px solid var(--bg-button-primary);
    border-radius: 0.3em;
    padding: 0.3em;
    margin-top: 0.3em;
    max-width: 90vw;
    background-color: rgba(73, 169, 108, 0.05);
}

.metadoc-content .section .item {
    width: 100%;
    padding: 0.4em;
}

.metadoc-content .item span:first-child {
    margin-right: 1em;
    min-width: 5em;
}

.metadoc-content .item span:last-child {
    border: 1px solid var(--fg-metadoc);
    border-radius: 0.1em;
    font-weight: 600;
    padding: 0.2em;
    min-width: 15%;
    float: right;
    text-align: right;
    color: var(--fg-metadoc);
    background-color: var(--bg-unwash);
}

table.dataview {
    margin: 1em 0.5em;
    padding: 0.2em;
}

.small {
    font-size: 0.8em;
}

table.dataview td:first-child {
    padding-right: 1em;
    color: var(--fg-tree);
}

/**
 * datalist
 */
.datalist {
    display: flex;
    flex-flow: column nowrap;
}

.datalist-head {
    display: flex;
    flex-flow: row nowrap;
}

.datalist-body {
    display: flex;
    flex-flow: column nowrap;
}

.datalist table {
    empty-cells: show;
}

.datalist thead {
    height: 2em;
}

.datalist.sticky-header thead tr {
    position: sticky;
    top: 0;
    background-color: var(--bg-sticky-header);
}

.datalist th.sortable {
    cursor: pointer;
}

.datalist th.sortable span.sortable {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    display: inline-block;
    width: 2em;
    height: 1em;
}

.datalist th.sortable:hover {
    background-color: var(--bg-listbox-hover);
}

.datalist th.sort-down span.sortable {
    background-image: url('images/sort-down.svg');
}

.datalist th.sort-up span.sortable {
    background-image: url('images/sort-up.svg');
}

.datalist tbody {
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.datalist td,
.datalist th {
    text-align: left;
    padding: 0.4em;
}

.datalist tr:last-child th {
    border-bottom: 1px solid var(--panel-border);
}

/**
 * input grid layout
 */
table.grid {
    margin: 0.3em;
}

table.grid td {
    padding: 0.3em 0;
}

table.grid td:first-child input {
    width: 20em;
}

table.grid td:first-child input.date {
    width: 9em;
}

table.grid tbody tr:first-child td {
    padding: 0.2em 0 0.2em 0;
}

table.grid tbody tr:last-child td {
    padding: 0.2em 0 0.5em 0;
}

table.grid td.expand span {
    display: inline-block;
    width: 1em;
}

table.grid tr.waiting td.expand {
    background: url("images/field-waiting.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    opacity: 0.7;
}

table.grid thead th {
    padding: 0.3em 0 0.5em 0;
    border-bottom: 1px solid var(--field-border-color);
    font-weight: 700;
    color: var(--fg-grid-head);
}

table.grid tfoot th {
    vertical-align: middle;
    border-top: 1px solid var(--field-border-color);
    border-bottom: 1px solid var(--field-border-color);
    padding: 0.3em 0;
    font-weight: 700;
    color: var(--fg-grid-head);
}

table.grid tfoot th.total {
    padding: 0.3em;
}

table.grid th.delete {
    min-width: 1em;
    background-color: transparent;
}

table.grid td.delete span {
    display: inline-block;
    width: 2em;
    padding: 0.3em;
    margin-left: 0;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xOSAyNGgtMTRjLTEuMTA0IDAtMi0uODk2LTItMnYtMTZoMTh2MTZjMCAxLjEwNC0uODk2IDItMiAyem0tNy0xMC40MTRsMy4yOTMtMy4yOTMgMS40MTQgMS40MTQtMy4yOTMgMy4yOTMgMy4yOTMgMy4yOTMtMS40MTQgMS40MTQtMy4yOTMtMy4yOTMtMy4yOTMgMy4yOTMtMS40MTQtMS40MTQgMy4yOTMtMy4yOTMtMy4yOTMtMy4yOTMgMS40MTQtMS40MTQgMy4yOTMgMy4yOTN6bTEwLTguNTg2aC0yMHYtMmg2di0xLjVjMC0uODI3LjY3My0xLjUgMS41LTEuNWg1Yy44MjUgMCAxLjUuNjcxIDEuNSAxLjV2MS41aDZ2MnptLTgtM2gtNHYxaDR2LTF6Ii8+PC9zdmc+");
    background-repeat: no-repeat;
    background-size: 1em;
    background-position-x: center;
    background-position-y: center;
    border: 2px solid var(--field-border-color);
    font-weight: 700;
    cursor: pointer;
    opacity: 0.4;
    text-align: center;
    color: transparent;
}

table.grid td.delete:hover span {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xOSAyNGgtMTRjLTEuMTA0IDAtMi0uODk2LTItMnYtMTZoMTh2MTZjMCAxLjEwNC0uODk2IDItMiAyem0tNy0xMC40MTRsMy4yOTMtMy4yOTMgMS40MTQgMS40MTQtMy4yOTMgMy4yOTMgMy4yOTMgMy4yOTMtMS40MTQgMS40MTQtMy4yOTMtMy4yOTMtMy4yOTMgMy4yOTMtMS40MTQtMS40MTQgMy4yOTMtMy4yOTMtMy4yOTMtMy4yOTMgMS40MTQtMS40MTQgMy4yOTMgMy4yOTN6bTEwLTguNTg2aC0yMHYtMmg2di0xLjVjMC0uODI3LjY3My0xLjUgMS41LTEuNWg1Yy44MjUgMCAxLjUuNjcxIDEuNSAxLjV2MS41aDZ2MnptLTgtM2gtNHYxaDR2LTF6Ii8+PC9zdmc+");
    background-repeat: no-repeat;
    background-size: 1.2em;
}

table.grid tr:last-child td.delete span,
table.grid td.delete.flock,
table.grid tr:last-child td.flock {
    display: none;
}

table.grid td.delete.flock {
    display: none;
}

table.grid input.date {
    width: 9em;
}

table.grid input.pence,
table.grid input.pounds {
    width: 10em;
}

/**
 * rform
 */
.rform-panel {
    position: relative;
}

.rform-panel h3 {
    border-bottom: 1px solid var(--panel-border);
}

.rform-panel h3 span {
    display: inline-block;
    max-width: 65vw;
    text-overflow: ellipsis;
    overflow: hidden;
    text-wrap: nowrap;
}

.rform-add {
    margin: var(--main-margin);
}

button.rform-delete {
    float: right;
    background-color: transparent;
    width: 1.5em;
    min-width: 1.5em;
    margin-right: 3em;
}

button.rform-delete span {
    display: inline-block;
    width: 1.3em;
    height: 1.3em;
    background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnIHN0YW5kYWxvbmU9J25vJyA/PjwhRE9DVFlQRSBzdmcgUFVCTElDICctLy9XM0MvL0RURCBTVkcgMS4xLy9FTicgJ2h0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCc+PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyB2ZXJzaW9uPScxLjEnIHdpZHRoPScxMDgwJyBoZWlnaHQ9JzEwODAnIHZpZXdCb3g9JzAgMCAxMDgwIDEwODAnIHhtbDpzcGFjZT0ncHJlc2VydmUnPjxnIHRyYW5zZm9ybT0nbWF0cml4KDEgMCAwIDEgNTQwIDU0MCknPjxyZWN0IHN0eWxlPSdzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI2LDI2LDI2KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47JyB2ZWN0b3ItZWZmZWN0PSdub24tc2NhbGluZy1zdHJva2UnIHg9Jy01NDAnIHk9Jy01NDAnIHJ4PScwJyByeT0nMCcgd2lkdGg9JzEwODAnIGhlaWdodD0nMTA4MCcgLz48L2c+PGcgdHJhbnNmb3JtPSdtYXRyaXgoMS4zNyAwIDAgMS4zNyA1MzAuNyA1NTAuNDYpJyA+PHBhdGggc3R5bGU9J3N0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjYsMjYsMjYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7JyB2ZWN0b3ItZWZmZWN0PSdub24tc2NhbGluZy1zdHJva2UnIHRyYW5zZm9ybT0nIHRyYW5zbGF0ZSgtNDgwLCA0ODApJyBkPSdNIDI4MCAtMTIwIFEgMjQ3IC0xMjAgMjIzLjUgLTE0My41IFEgMjAwIC0xNjcgMjAwIC0yMDAgTCAyMDAgLTcyMCBMIDE2MCAtNzIwIEwgMTYwIC04MDAgTCAzNjAgLTgwMCBMIDM2MCAtODQwIEwgNjAwIC04NDAgTCA2MDAgLTgwMCBMIDgwMCAtODAwIEwgODAwIC03MjAgTCA3NjAgLTcyMCBMIDc2MCAtMjAwIFEgNzYwIC0xNjcgNzM2LjUgLTE0My41IFEgNzEzIC0xMjAgNjgwIC0xMjAgTCAyODAgLTEyMCBaIE0gNjgwIC03MjAgTCAyODAgLTcyMCBMIDI4MCAtMjAwIEwgNjgwIC0yMDAgTCA2ODAgLTcyMCBaIE0gMzYwIC0yODAgTCA0NDAgLTI4MCBMIDQ0MCAtNjQwIEwgMzYwIC02NDAgTCAzNjAgLTI4MCBaIE0gNTIwIC0yODAgTCA2MDAgLTI4MCBMIDYwMCAtNjQwIEwgNTIwIC02NDAgTCA1MjAgLTI4MCBaIE0gMjgwIC03MjAgTCAyODAgLTIwMCBMIDI4MCAtNzIwIFonIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgLz48L2c+PC9zdmc+");
    background-repeat: no-repeat;
    background-size: 1.3em;
    background-position-x: center;
    background-position-y: center;
    font-weight: 700;
    cursor: pointer;
}

button.rform-delete:hover {
    transform: scale(1.1);
}

button.rform-delete.flock,
.rform-add.flock {
    display: none;
}

.rform-popup {
    overflow: auto;
    border: 1px solid var(--fg-titlebar);
    background-color: var(--bg-unwash);
    position: absolute;
    right: 1em;
    top: 2em;
    padding: 0.3em;
}

/**
 * search
 */
.field.search {
    width: 100%;
}

.field.search div.label,
.field.search div.expand {
    display: none;
}

.field.search div {
    display: flex;
    flex-grow: 100;
}

button.search {
    width: 3em;
    min-width: 3em;
    margin: 0;
    height: 100%;
    flex-grow: 0;
}

button.search span {
    margin-top: 0.3em;
}

button.search.waiting span {
    display: none;
}

input.search {
    flex-grow: 1;
    height: 100%;
    border-radius: 0;
}

input.search:focus-visible {
    outline: none;
}

.tile {
    position: relative;
}

/**
 * tile
 */
.tile img {
    margin: 0.3em;
    height: 2.5em;
    float: left;
    background-color: var(--bg-preloader);
}

.tile .text {
    font-size: 1.6em;
}

/**
 * cards
 */
.card {
    color: var(--fg-tree);
    padding: 0.3em;
    font-weight: 400;
    margin: 0.3em 0;
    display: flex;
    justify-content: space-between;
}

.card:has(+ .card) {
    border-bottom: 1px solid var(--field-border-color);
}

.card-col {
    display: flex;
    flex-flow: column;
}

.card-col.card-right {
    text-align: right;
}

.card-large {
    font-weight: 600;
    font-size: 1.5em;
}

.card-medium {
    font-weight: 400;
    font-size: 1.2em;
}

.card-small {
    font-weight: 400;
    font-size: 1em;
}

.info-table {
    color: var(--fg-tree);
}

/* info table */
.info-table th {
    padding: 0.4em 0.5em;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--field-border-color);
    vertical-align: top;
}

.info-table thead th {
    font-size: 1.2em;
}

.info-table tbody th {
    font-size: 1em;
    padding-right: 1em;
}

.info-table td {
    padding: 0.4em 1em;
    border-bottom: 1px solid var(--field-border-color);
}

/** review these */
th.text {
    text-align: left;
}

th.pence,
td.pence,
th.pounds,
td.pounds {
    text-align: right;
}

/** xl */
.xl {
    margin: 0.2em 0.2em;
    border: 1px solid var(--bg-trpview);
}

.xl-hdr {
    height: 1.5em;
}

.xl-rows {
    height: calc(100% - 1.5em);
    overflow: auto;
}

.xl.waiting .xl-row.xl-hdr::after {
    content: "";
    display: inline-block;
    width: 2em;
    height: 2em;
    background: url("images/field-waiting.gif?v=26_1020_1321_20");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2em;
    opacity: 0.7;
}

.xl-row {
    height: 1.5em;
}

.xl-cell {
    color: var(--input-text-color);
    display: inline-block;
    border-right: 1px solid var(--border-xl);
    border-bottom: 1px solid var(--border-xl);
    height: 100%;
    vertical-align: top;
    overflow: hidden;
    text-wrap: nowrap;
    user-select: none;
    padding: 0 0.2em;
}

.xl-cell:focus-within {
    padding: 0;
}

.xl-right {
    text-align: right;
}

.xl-center {
    text-align: center;
}

.xl-hdr .xl-cell {
    background-color: var(--bg-preloader);
}

.xl-rows:focus-visible {
    outline: none;
}

.xl-rows input {
    padding: 0;
    border: none;
    border-radius: 0;
    font-weight: 400;
}

.xl-cur {
    border: 1px solid var(--fg-titlebar);
}

.xl-hdr .xl-cur {
    border-color: var(--border-xl);
    font-weight: 600;
}

.xl-dropdown {
    overflow: auto;
    border: 1px solid var(--fg-titlebar);
    background-color: var(--bg-unwash);
    position: absolute;
    height: 30vh;
    min-width: 10vw;
    width: fit-content;
}

.xl-dropdown p.xl-selected {
    background-color: darkblue;
    color: var(--fg-button);
}

.xl-cell.xl-buttons button {
    padding: 0;
    margin: 10%;
    min-width: 1em;
    height: 80%;
}

button.xl-delete {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath fill='%23ff5a5b' d='m376-300 104-104 104 104 56-56-104-104 104-104-56-56-104 104-104-104-56 56 104 104-104 104 56 56Zm-96 180q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520Zm-400 0v520-520Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1.4em;
    background-position-x: center;
    background-position-y: center;
}

button.xl-delete:hover {
    background-size: 1.5em;
}

.popuperror {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    background-color: var(--bg-button-delete);
    color: var(--fg-error);
    border: 1px solid var(--fg-input-error);
    border-radius: 5px;
    padding: 0.5em;
}

.popuperror.fade-in {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s linear;
}

.popuperror.fade-out {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 3s, opacity 2s 1s linear;
}

.datepicker {
    background-color: var(--bg-wash);
    border: 1px solid var(--panel-border);
    padding: 1em;
}

.datepicker thead th {
    padding-top: 1em;
    padding-bottom: 1em;
}

.datepicker td,
.datepicker tr {
    text-align: center;
    padding: 0.5em;
}

.datepicker td:not(.bold) {
    font-weight: 200;
}

.datepicker td.selected {
    background-color: var(--bg-page-head);
    color: var(--fg-button);
    border: 1px solid var(--bg-page-head);
    border-radius: 50%;
}

.bold {
    font-weight: 600;
}

.red-warning-text {
    color: var(--fg-red-warning);
}

.margin-bottom-1 {
    margin-bottom: 1em;
}

.margin-right-1 {
    margin-right: 1em;
}

div.tagbutton {
    display: flex;
    justify-content: space-between;
    width: 8em;
    line-height: 2;
    border-radius: var(--panel-border-radius);
    border: 1px solid var(--panel-border);
    margin-right: 0.5em;
}

span.tagbuttonlabel {
    margin-left: 1em;
}

span.tagbuttondelete {
    align-self: flex-end;
    padding: 0 0.5em;
}

span.countSpan {
    margin-right: 0.3em;
}