.t3s-apt {
    --t3s-apt-bg: #f5f6fa;
    --t3s-apt-tile: #e3e4e8;
    --t3s-apt-icon-bg: #ecedf1;
    --t3s-apt-color: #1d2733;
    --t3s-apt-accent: #1f4b7a;
    --t3s-apt-danger: #b42318;
    background: var(--t3s-apt-bg);
    color: var(--t3s-apt-color);
    padding: clamp(1rem, 4vw, 3rem);
}

.t3s-apt__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: 1.5rem 2rem;
}

.t3s-apt__tile {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    min-height: 5.5rem;
    background: var(--t3s-apt-tile);
    outline: 2px solid transparent;
}

.t3s-apt__tile--wide { grid-column: 1 / -1; }
.t3s-apt__tile.is-invalid { outline-color: var(--t3s-apt-danger); }

.t3s-apt__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--t3s-apt-icon-bg);
    color: var(--t3s-apt-accent);
}

.t3s-apt__field {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .5rem 1.25rem;
    min-width: 0;
}

.t3s-apt__label {
    font-size: .75rem;
    opacity: .7;
    margin: 0 0 .1rem;
}

.t3s-apt__field input,
.t3s-apt__field select,
.t3s-apt__field textarea {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    padding: .25rem 0;
}

.t3s-apt__field select {
    appearance: none;
    cursor: pointer;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath fill='%231f4b7a' d='M5 0 10 5H0zM5 14 0 9h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: .6rem;
}

.t3s-apt__field textarea { resize: vertical; }

.t3s-apt__field :focus-visible {
    outline: 2px solid var(--t3s-apt-accent);
    outline-offset: 2px;
}

.t3s-apt__static strong { display: block; font-weight: 500; }
.t3s-apt__static small { font-size: .8rem; }

.t3s-apt__error {
    color: var(--t3s-apt-danger);
    font-size: .8rem;
}

.t3s-apt__submit {
    min-height: 5.5rem;
    border: 0;
    background: var(--t3s-apt-accent);
    color: #fff;
    font: inherit;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: filter .15s;
}

.t3s-apt__submit:hover { filter: brightness(1.15); }

.t3s-apt__alert {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--t3s-apt-danger);
    background: #fff;
}

.t3s-apt__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.t3s-apt__summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .25rem 1.5rem;
    margin: 1rem 0 0;
}

.t3s-apt__summary dt { font-weight: 600; }
.t3s-apt__summary dd { margin: 0; }

.t3s-apt__req { color: var(--t3s-apt-danger); }

.t3s-apt__hint {
    grid-column: 1 / -1;
    margin: 0;
    font-size: .8rem;
    opacity: .8;
}

.t3s-apt__debug {
    margin: .75rem 0 0;
    font-size: .8rem;
    white-space: pre-wrap;
}
