* {
    --tinyui-colorful-text-color: #FFF;
    --tinyui-success-color: #398712; /* pico-color-green-500 */
    --tinyui-error-color: #D93526; /* pico-color-red-500 */
    --tinyui-warn-color: #FF9500; /* pico-color-pumpkin-300 */
}

:not(form) button[type="button"] {
    margin-bottom: 0;
}

:is(div):is([data-type="success"]) {
    background-color: var(--tinyui-success-color);
    color: var(--tinyui-colorful-text-color);
}

:is(div):is([data-type="error"]) {
    background-color: var(--tinyui-error-color);
    color: var(--tinyui-colorful-text-color);
}

:is(div):is([data-type="warn"]) {
    background-color: var(--tinyui-warn-color);
    color: var(--tinyui-colorful-text-color);
}

/* Overlay */
.tinyui_overlay_container {
    width: 0;
    height: 0;
}

.tinyui_overlay_layer {
    position: fixed;
    z-index: 9999; /* Increased z-index to ensure it's on top of everything */
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Drawer */
.tinyui_drawer_bg_shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--pico-modal-overlay-background-color);
}

.tinyui_drawer_wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
}

.tinyui_drawer_container {
    background-color: var(--pico-background-color);
    box-shadow: var(--pico-box-shadow);
    border-radius: 0 0 var(--pico-border-radius) var(--pico-border-radius);
}

/* Icon */
.tinyui_svg_icon {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none; /* Let clicks pass through to parent button */
}

/* Toast */
.tinyui_toast_wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  padding-bottom: 20vh;
  align-items: end;
  justify-content: center;
}

.tinyui_toast_inner {
    flex: "0 0 auto";
    border-radius: var(--pico-border-radius);
    padding: var(--pico-spacing);
    background-color: var(--pico-background-color);
    box-shadow: var(--pico-box-shadow);
    color: var(--pico-color);
    word-break: break-word;
    transition: none;
}

/* Dialog */
.tinyui_dialog_bg_shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--pico-modal-overlay-background-color);
}

.tinyui_dialog_wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--pico-spacing);
}

.tinyui_dialog_container {
    background-color: var(--pico-background-color);
    box-shadow: var(--pico-box-shadow);
    border-radius: var(--pico-border-radius);
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}

.tinyui_dialog_header {
    flex: 0 0 auto;
    border-bottom: var(--pico-border-width) solid var(--pico-card-border-color);
    padding: var(--pico-spacing);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tinyui_dialog_header>:is(h1, h2, h3, h4, h5, h6) {
    margin-bottom: 0;
}

.tinyui_dialog_header_close {
    cursor: pointer;
    border-radius: var(--pico-border-radius);
    border: none;
    background-color: transparent;
    color: inherit;
}

.tinyui_dialog_header_close:is(:hover, :focus) {
    background-color: var(--tinyui-error-color);
    color: var(--tinyui-colorful-text-color);
}

.tinyui_dialog_body {
    flex: 1 1 auto;
    overflow: auto;
    max-width: 100%;
}

.tinyui_dialog_footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--pico-spacing);
}
