.main-zone {
    flex: 4;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 20px;
    margin-right: 10px;
    min-height: 200px;

}

/* Automatic dates: each row holds a label, a datetime/number input,
   a "Set to..." template button and an "Erase" button. */
.auto-date-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.auto-date-row > label {
    min-width: 7em;
    font-weight: 500;
    color: var(--font-dark);
}

.auto-date-row > input {
    flex: 0 1 auto;
    margin: 0;
}

.auto-date-row + .auto-date-row {
    margin-top: 18px;
}

/* Pictures for delete / insert */

div.ins_sym,
div.del_sym {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    background-color: transparent;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease,
        transform 0.08s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

div.ins_sym {
    background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 5 2 V 8 M 2 5 H 8' stroke='%234f46e5' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

div.del_sym {
    background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 2.88 2.88 L 7.12 7.12 M 7.12 2.88 L 2.88 7.12' stroke='%23dc2626' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

div.ins_sym.clickable:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.08);
}

div.del_sym.clickable:hover {
    background-color: #fee2e2;
    border-color: #dc2626;
    transform: scale(1.08);
}

div.ins_sym.clickable:active,
div.del_sym.clickable:active {
    transform: scale(0.96);
}


/* Things for the question part */
.question {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    padding-right: 18px;
    background-color: var(--surface-subtle);
    margin-bottom: 12px;
    margin-top: 12px;
    margin-right: 10px;
    font-size: 100%;
    position: relative;
    box-shadow: var(--box-shadow);
}

.fake_question {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 14px;
    margin-bottom: 16px;
    margin-top: 14px;
    margin-right: 10px;
    font-size: 100%;
    position: relative;
}

.blur {
    filter: blur(1px) opacity(70%);
}

.qro {
    transform: scale(0.8);
    margin-right: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
}

.qro_container {
    position: relative;
    margin-right: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.question input {
    font-size: 100%;
}

.qtitle, .qtype, .qans {
    font-size: 120%;
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
    margin-top: 5px;
}

.qtit {
    width: 80%;
}

.qtype, .qans {
    font-size: 110%;
}

.expand_sort > div, .expand_grade > div, .expand_select > div {
    margin-top: 8px;
    padding: 14px 18px;
    width: 70%;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--background-light);
    box-shadow: var(--box-shadow);
}

.expand_select > div {
    margin-left: 0;
    margin-right: 0;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.expand_select > div > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expand_select > div > div label {
    cursor: pointer;
    user-select: none;
    color: var(--font-dark);
    flex: 1;
}

.expand_select input[type=number] {
    width: 4.5em;
    margin: 0;
    text-align: center;
    padding: 6px 8px;
    flex-shrink: 0;
}

.expand_sort > div {
    margin-left: auto;
    margin-right: auto;
}

.expand_grade > div {
    margin-left: auto;
    margin-right: 5px;
    width: 50%;
}

.expand_sort input[type=number] {
    width: 4em;
    padding: 6px 8px;
    text-align: center;
}

.expand_grade input, .answers input {
    width: 80%;
}

.mention, .fake_mention, .answer, .fake_answer, .new_trustee {
    width: 100%;
    margin-left: 5%;
    position: relative;
}

.answers {
    width: 80%;
}

.answer {
    margin-left: 5px;
}
.fake_answer {
    margin-left: 5px;
    margin-bottom: 6px;
}

.new_trustee {
    margin-left: 10%;
    margin-bottom: 6px;
}

.fake_mention {
    margin-top: 6px;
}

.fake_mention .d_i_side, .fake_answer .d_i_side, .new_trustee .d_i_side {
    top: 0px;
}

.fake_mention > div:first-child, .fake_answer > div:first-child, .new_trustee > div:first-child{
    width: 80%;
    text-align: right;
    font-style: italic;
    font-size: 90%;
}

.fake_question > div:first-child {
    text-align: right;
    font-style: italic;
    font-size: 100%;
    color: var(--font-muted);
}

.d_i_side {
    display: inline-block;
    position: absolute;
    top: 5px;
    left: calc(80% + 15px);
    font-size: 100%;
    font-weight: bold;
}

.fake_question .d_i_side {
    font-size: 100%;
    position: static;
    top: auto;
    right: auto;
    left: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
}

.d_i_side div {
    display: inline-block;
    margin-right: 5px;
}


.d_i_side_top {
    display: inline-flex;
    gap: 6px;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 100%;
    font-weight: bold;
}

.d_i_side_top div {
    display: inline-block;
    margin-right: 0;
}

.mention .d_i_side, .answer .d_i_side {
    display: inline-block;
}


/* lists elections */
.answers_list {
    width: 80%;
    margin-top: 10px;
}
.answers_list input {
    width: 80%;
}
.answers_list .answer_label {
    width: 20%;
    display: inline-block;
}
.answers_list .answer_list_name input {
    width: 60%;
}

#previewbooth {
    text-align: center;
}

#previewbooth div {
    display: inline-block;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    background-color: var(--background-light);
    color: var(--accent);
    font-size: 120%;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
        box-shadow 0.2s ease, transform 0.05s ease;
    box-shadow: var(--button-shadow);
}

#previewbooth div:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: var(--button-shadow-hover);
    transform: translateY(-1px);
}

/* Things for the voters list part */

.main-zone__content > hr {
    margin-bottom: 20px;
}

#list_warning {
    text-align: center;
    font-size: 120%;
}
#list_warning strong {
    font-weight: bold;
}

#list_warning2 {
    text-align: center;
    font-style: italic;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.iflog, .ifw, .ifsetup, .ifopen {
    display: none;
}

#login:checked ~ table .iflog, #poids:checked ~ table .ifw, #rad_setup:checked ~ table .ifsetup, #rad_run:checked ~ table .ifopen {
    display: table-cell;
}

#rad_setup:checked ~ div.ifsetup {
    display: block;
}

#rad_run:checked ~ div.ifopen {
    display: block;
}

th {
    color: var(--font-dark);
    background-color: var(--surface-subtle);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-subtle);
}
th:first-child {
    width: 50%;
    border-top-left-radius: var(--radius-sm);
}
th:last-child {
    width: 10%;
    background-color: transparent;
    border-top-right-radius: var(--radius-sm);
}
.ifw {
    width: 10%;
}
.iflog {
    width: 30%;
}

td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 14px;
}
td:last-child {
    border-bottom: 0;
}

table {
    margin-top: 20px;
    margin-bottom: 20px;
    border-collapse: collapse;
    width: 100%;
}
tbody tr:hover {
    background-color: var(--surface-subtle);
}

#addtolist {
    margin-top: 20px;
}

#addtolist textarea {
    vertical-align:top;
}

/* Overlay the help "?" tooltip on the top-right corner of the textarea
   so it doesn't get pushed below when the textarea is full-width. */
.textarea-with-tooltip {
    position: relative;
}

.textarea-with-tooltip > .tooltip {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltiptext {
    position:absolute;
    bottom: calc(100% + 10px);
    right: 0;
    left: auto;
    top: auto;
    line-height:1.5em;
    border:1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size:90%;
    display:none;
    width: 400px;
    max-width: min(400px, calc(100vw - 40px));
    padding:10px 12px;
    background-color: var(--background-light);
    color: var(--font-dark);
    box-shadow: var(--box-shadow);
    z-index: 10;
    text-align: left;
    font-weight: normal;
    white-space: normal;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 6px;
    border: 6px solid transparent;
    border-top-color: var(--background-light);
    margin-top: -1px;
}

.tooltip:hover .tooltiptext {
    display:inline-block;
}

.tooltip div:first-child {
    display:inline-block;
    width:3ex;
    line-height:3ex;
    text-align:center;
    border-radius:1.5ex;
    background-color: var(--accent);
    color: var(--font-light);
    font-weight: 600;
    font-size: 11px;
}

.trustee-link {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--accent) !important;
    background: var(--background-light);
    padding: 4px 10px;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.trustee-link:hover {
    background-color: var(--accent) !important;
    color: var(--font-light) !important;
    border-color: var(--accent);
}

.trustee-links {
    line-height: 3ex;
}
