.smallbutton
{
    font: inherit;
    display: flex;
    flex-direction: row;
    cursor: pointer;
    background: floralwhite;
    padding: 2px 5px;
    gap: 5px;
    font-size: 90%;
    color: black;
    border: 1px solid silver;
    transition: all 0.3s ease;
    justify-content: flex-start;
    align-items: center;
}
.smallbutton.blue
{
    background: lightcyan;
}
.smallbutton img
{
    height: clamp(20px, 2.5cqh, 25px);
    width: auto;
    aspect-ratio: 1/1;
}
.smallbutton .sb_icon
{
    flex: 1;
    flex-grow: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.smallbutton .sb_text
{
    flex: 1;
    flex-grow: 1;
}
.smallbutton:hover
{
    border-color: black;
    filter: brightness(90%);
}
.smallbutton:active
{
    transition: none;
    filter: invert(100%);
}



.gui_tabcontrol_buttons
{
    margin-top: 3vh;
    display: flex;
    flex-direction: row;
    
    flex-wrap: wrap;
    padding: 5px 10px;;
    margin-bottom: 1vh;
}
.gui_tabcontrol_buttons > div
{
    box-sizing: border-box;
}
.gui_sharedpanel
{
    flex: 1;
    flex-grow: 1;
    flex-basis: auto;
    display: flex;
    flex-direction: row;
    
}
.gui_sharedpanel > div
{
    flex: 1;
}


.gui_tabbutton
{
    background: whitesmoke;
    padding: 0.5vw 1vh;
    font-size: 11pt;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    color: black;
    box-sizing: border-box;
    justify-content: flex-start;
    align-items: center;
    border: 1px solid silver;
    outline: 1px solid silver;
    height: min(35px, 6vh);
}
.gui_tabbutton.green
{
    background: rgba(192, 220, 9, 0.5);
    color: black;
    justify-content: center;
    padding: 2px 10px;
}
.gui_tabbutton.red
{
    background: #ffe6e6;
}

.gui_tabbutton.green:hover
{
    background: rgba(192, 220, 9, 0.8);
    color: black;
}
.gui_tabbutton.gray
{
    background: #f2f2f2;
    color: black;
    justify-content: center;
    padding: 2px 10px;
}
.gui_tabbutton.gray:hover
{
    background: #d9d9d9;
    color: black;
}

.gui_tabbutton.nomenu
{
    font-weight: normal !important;
}

.gui_tabbutton_icon
{
    flex: 1;
    flex-grow: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.gui_tabbutton_icon img
{
    height: clamp(20px, 4vh, 25px);
    width: auto;
    
}
.gui_tabbutton_caption
{
    flex: 1;
    flex-grow: 1;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gui_tabbutton[data-selected="1"]
{
  outline: 1px solid #95ab07;
  border-color: black;
  background: #c3cf73;
}

.gui_tabbutton:hover
{
    background: rgb(192, 220, 9, 0.5);
    border-color: black;
}
.gui_tabbutton:active
{
    transition: none;
    filter: invert(100%);
}
.gui_tabbutton[data-enabled="0"]
{
    pointer-events: none;
    filter: grayscale(100%);
    opacity: 0.5;
    color: silver;
    outline: none;
    border: none;
}
.gui_tabbutton[data-enabled="0"] img
{
    opacity: 0.6;
    
}


.gui_tabcontrol_page
{
    flex: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1vh;
    margin: 1vh 2vh;
    
}

.gui_tabcontrol_page[data-visible="0"]
{
    display: none;
}


@media screen and (max-width: 500px)
{
    .gui_tabbutton
    {
        flex-basis: 100%;
    }
     .gui_tabbutton.gray
    {
        flex-basis: auto;
    }
    .gui_tabbutton img
    {
        /*height: 18px;*/
    }
    .gui_tabcontrol_page
    {
        margin: 0;
    }

}


.gui_defaultbutton
{
    flex: 1;
    flex-grow: 0;
    color: black;
    display: flex;
    flex-direction: row;
    border: 1px solid black;
    gap: 10px;
    cursor: pointer;
    background: #d1e0e0;
    padding: 0.5vh 1vw;
    transition: all 0.3s ease;
    font: inherit;
    box-sizing: border-box;
    color: black;
    user-select: none;
    flex-basis: max-content;
    font-size: 90%;
    min-width: 100px;
    text-align: center;
    justify-content: center;
    align-items: center;
}
.gui_defaultbutton[data-enabled="0"]
{
    pointer-events: none;
    opacity: 0.5;
    color: dimgray;
    filter:grayscale(100%);
    border-color: dimgray;
}
.gui_defaultbutton[data-enabled="0"] img
{
    opacity: 0.6;
}
.gui_defaultbutton[data-color="red"]
{
    background: #ffe0e0;
}
.gui_defaultbutton[data-color="transparent"]
{
    background: transparent;
    border-color: silver;
}
.gui_defaultbutton[data-color="transparent"]:hover
{
    background: whitesmoke;
    border-color: black;
}
.gui_defaultbutton:hover
{
    filter: brightness(115%);
}
.gui_defaultbutton:active
{
    transition: none;
    filter: invert(100%);
}
.gui_defaultbutton > div
{
    box-sizing: border-box;
}
.gui_defaultbutton .db_icon
{
    flex: 1;
    flex-grow: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.gui_defaultbutton .db_icon img
{
    height: clamp(20px, 2vh, 35px);
    width: auto;
    aspect-ratio: 1/1;
}
.gui_defaultbutton .db_caption
{
    flex: 1;
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    white-space: nowrap;
    align-items: center;
}
.gui_defaultbutton .db_caption > div
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 500px)
{
    .gui_defaultbutton
    {
        flex-basis: 45%;
        min-width: unset;
    }
}

.gui_buttonrows
{
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    justify-content: center;
    align-items: stretch;
}

.gui_buttonrow
{
    flex: 1;
    flex-grow: 0;
    display: flex;
    flex-direction: row;
    gap: 1vw;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}


.myinput
{
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* Bei Textarea: Label oben ausrichten statt vertikal zentriert */
.myinput--textarea
{
    align-items: flex-start;
}

.myinput-label
{
    flex: 0 0 auto;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

/* Bei Textarea sitzt das Label oben am Feld, nicht auf halber Höhe */
.myinput--textarea .myinput-label
{
    padding-top: 0.55rem;
}

.myinput-field
{
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.myinput-input
{
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 2.4rem 0.55rem 0.7rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    border: 1px solid #c4c4c4;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Textarea-spezifisch: vertikal größenveränderbar, Mindesthöhe, Schrift einheitlich */
textarea.myinput-input
{
    resize: vertical;
    min-height: 4.5rem;
    line-height: 1.4;
    font-family: inherit;
}
.myinput-input[data-pinmode="1"]
{
    text-align: center;
    font-family: monospace;
    font-size: 30px;
    letter-spacing: 18px;
    font-weight: bold;
}

.myinput-input:focus
{
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}
.myinput-input[readonly]
{
    color: gray;
    background: whitesmoke;
}
.myinput-clear
{
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.7rem;
    height: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e6e6e6;
    color: #555;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Bei Textarea: Button oben fixieren statt mittig */
.myinput--textarea .myinput-clear
{
    top: 0.35rem;
    transform: none;
}

.myinput-clear:hover
{
    background: #d23b3b;
    color: #fff;
}

@media (hover: none)
{
    .myinput-clear
    {
        width: 2rem;
        height: 2rem;
    }
}

@media (max-width: 420px)
{
    .myinput
    {
        flex-wrap: wrap;
    }
    .myinput-label
    {
        flex: 1 1 100%;
    }
}

.attachctl
{
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.attachctl-label
{
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.4rem;
}

.attachctl-zone
{
    border: 2px dashed #b8c2cc;
    border-radius: 8px;
    background: #fafbfc;
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.attachctl-zone:hover
{
    border-color: #4a90d9;
    background: #f0f6fc;
}

.attachctl-zone.is-dragover
{
    border-color: #4a90d9;
    background: #e3f0fb;
}

.attachctl-zone-inner
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.attachctl-icon
{
    font-size: 1.6rem;
    color: #6b7986;
    line-height: 1;
}

.attachctl-hint
{
    font-size: 0.9rem;
    color: #6b7986;
}

.attachctl-btn
{
    border: 1px solid #4a90d9;
    background: #4a90d9;
    color: #fff;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.attachctl-btn:hover
{
    background: #3a7bc0;
}

.attachctl-list
{
    margin-top: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachctl-item
{
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    background: #fff;
}

.attachctl-thumb
{
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f4;
}

.attachctl-thumb img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachctl-thumb.is-pdf
{
    font-size: 0.8rem;
    font-weight: 700;
    color: #d23b3b;
    background: #fdeeee;
}

.attachctl-meta
{
    flex: 1 1 auto;
    min-width: 0;
}

.attachctl-fname
{
    font-size: 0.9rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachctl-fsize
{
    font-size: 0.78rem;
    color: #8a939c;
}

.attachctl-del
{
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    border-radius: 50%;
    background: #e6e6e6;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.attachctl-del:hover
{
    background: #d23b3b;
    color: #fff;
}

@media (hover: none)
{
    .attachctl-del
    {
        width: 2.2rem;
        height: 2.2rem;
    }
}

@media (max-width: 420px)
{
    .attachctl-zone
    {
        padding: 1rem 0.6rem;
    }
}

.mainmenu
{
    
}
.mainmenu[data-pos="1"]
{
    border-top-left-radius: 10px;
}
.mainmenu[data-pos="4"]
{
    border-top-right-radius: 10px;
}

@media (max-width: 500px)
{
    .mainmenu[data-pos="1"]
    {
        border-top-left-radius: 10px;
    }
    .mainmenu[data-pos="2"]
    {
        border-top-right-radius: 10px;
    }
    
    .mainmenu[data-pos="3"]
    {
        border-top-right-radius: 0px;
    }
    .mainmenu[data-pos="4"]
    {
        border-top-right-radius: 0px;
    }
}



.modern-select 
{
    appearance: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    width: 100%;
    max-width: 300px;
    cursor: pointer;
    text-overflow: ellipsis;
}

@media screen and (max-height: 800px) 
{
  .modern-select 
  {
      max-width: 100%;
  }
  
}



.modern-select:focus {
    border-color: #0077cc;
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
    outline: none;
}

.modern-select[disabled] {
    background-color: #f9f9f9;
    color: #aaa;
    cursor: not-allowed;
}

.modern-select option[disabled] {
    color: #bbb;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 300px;
}

.select-label {
   margin-bottom: 2px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
}



.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    user-select: none;
}

.custom-checkbox-image {
    width: 20px;
    height: 20px;
    align-self: flex-start;
}

.custom-checkbox-caption 
{
    font-size: 0.95rem;
    color: #333;
}


/* ── Basis-Button ───────────────────────────────────────────────────────── */
.mainbutton {
  /* Layout über die inneren divs hinweg: Icon + Text nebeneinander, zentriert */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 1.5vh 2vw;
  border: 2px solid white;
  border-radius: 4vw;
  background: var(--sk-dark);
  color: #fff;

  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
    white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;   /* kein grauer Blitz auf Mobil */
  transition: background .15s, transform .1s, box-shadow .15s;
}
.mainbutton[data-small="1"]
{
    font-size: 12px;
    padding: 0.8vh 1.5vw;
    border-width: 1px;
    border-radius: 2vw;
}
/* Deine verschachtelten divs erben das Flex-Layout, damit Icon und Text
   sauber in einer Reihe sitzen, egal wie tief geschachtelt. */
.mainbutton > div,
.mainbutton > div > div {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.mainbutton img {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  filter: invert(100%);
}

/* ── Zustände ───────────────────────────────────────────────────────────── */
.mainbutton:hover  { background: var(--sk-accent-ink); }
.mainbutton:active { transform: translateY(1px); }   /* leichtes „Eindrücken" */

.mainbutton:focus-visible {
  outline: 3px solid var(--sk-accent);
  outline-offset: 2px;                                 /* Tastatur-Sichtbarkeit */
}

/* Deaktiviert über dein data-Attribut */
.mainbutton[data-enabled="0"] 
{
  background: var(--sk-line);
  cursor: not-allowed;
  pointer-events: none;
  border-color: silver;
  color: var(--sk-muted);
  opacity: 0.5;
}
.mainbutton[data-enabled="0"] img
{
    filter: unset;
    opacity: 0.8;
}

/* ── Varianten: über eine zweite Klasse am Button ───────────────────────── */

/* Sekundär / Abbruch — hell mit Rahmen statt gefüllt */
.mainbutton.is-secondary {
  background: var(--sk-surface);
  color: var(--sk-ink);
  box-shadow: inset 0 0 0 1px var(--sk-line);
}
.mainbutton.is-secondary:hover {
  background: var(--sk-bg);
  box-shadow: inset 0 0 0 1px var(--sk-accent);
}

/* Abbruch / Verwerfen mit dezentem Rot-Akzent */
.mainbutton.is-danger {
  background: var(--sk-surface);
  color: #B4452F;
  box-shadow: inset 0 0 0 1px #E7C6BD;
}
.mainbutton.is-danger:hover {
  background: #FBF1EE;
  box-shadow: inset 0 0 0 1px #B4452F;
}

/* Volle Breite, z. B. als Formular-Absenden auf dem Handy */
.mainbutton.is-block { width: 100%; }

.mainbutton[data-enabled="0"]
{
    pointer-events: none;
    filter: grayscale(100%);
}
.mainbutton:hover
{
    filter: brightness(110%);
    border-color: black;
}
.mainbutton:active
{
    transition: none;
    filter: invert(100%);
    
}
.button[data-enabled="0"]
{
    filter: grayscale(100%);
    pointer-events: none;
    opacity: 0.6;
    background: silver;
}
.mainbutton  > div
{
    flex: 1;
}
