@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Fira+Code:wght@300..700&family=Noto+Color+Emoji&display=swap');

:root {
    --rouge: #DA291C;
    --groseille: #B51F1F;
    --taupe: #413D3A;
    --canard: #007480;
    --leman: #00A79F;
    --perle: #CAC7C7;
    --emoji: "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Emoji", sans-serif;

    --max-width: 38rem;
}

* {
    box-sizing: border-box;
}

body,
html {
    box-sizing:border-box
}

html {
    font-family: 'IBM Plex Sans', sans-serif;
    line-height: 1.3;
}

input, select, button {
    font-size: unset;
    font-family: unset;
}

body {
    max-width: var(--max-width);
    margin: 1rem auto;
    padding: 0 1rem;
}

body:has(.ShowcasePage) {
    max-width: 48rem;
}

dialog {
    border: none;
    outline: thick solid var(--groseille);
    text-align: center;
    z-index: 1;
}

dialog::backdrop {
    backdrop-filter: blur(0.25rem);
}

pre, code, kbd, samp {
    font-family: 'IBM Plex Mono', monospace;
    line-height: 1.0;
}

h1, h2, h3, h4, h5, h6,
article, aside, details, footer, header, main, nav, section,
figure, form, ol, p, pre, ul, video, table {
    margin: 1rem 0;
}

ol, ul {
    padding-left: 1em;
}

header, fieldset, h1.title {
    border-radius: 0.5rem;
    padding: 0.5rem;
}

h1.title {
    background: var(--rouge);
    color: white;
}

h2 {
    color: var(--canard);
}

footer h3 {
    margin-top: 2rem;
}

p.finished {
    background: var(--leman);
    border: thick solid var(--canard);
    color:white;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
}

fieldset, fieldset:first-child:first-child {
    margin-top: -0.5rem;
    align-self: stretch;
}

fieldset input[type="radio"] {
    margin: 0.5rem;
}

fieldset label {
    padding: 0.25rem;
}

label {
    display: inline-block;
}

select, input, button {
    padding: 0.5rem;
}

input[type="submit"], button {
    padding: 0.5rem 1rem;
    margin-top: 1rem;
}

input[type="submit"] {
    align-self: end;
}

form > *:first-child {
    margin-top: 0;
}

form > *:last-child {
    margin-bottom: 0;
}

.grid-form {
    display: grid;
    grid-template-columns: max-content auto;
    align-items: center;
    gap: 0.5rem;
}

.grid-form label {
    text-align: right;
}

.IpBanner {
    border: thin solid var(--taupe);
    word-break: break-word;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

#banner-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.app-list h3 {
    border-bottom: thin solid rgba(0, 0, 0, 0.1);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8em, 1fr));
    grid-gap: 1rem;
}

.app-grid > a {
    color: inherit;
    display: grid;
    text-decoration: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.app-grid figure {
    word-wrap: break-word;
    border-radius: 0.5rem;
    box-shadow: rgba(0, 0, 0, 0.2) 0 2px 1px -1px, rgba(0, 0, 0, 0.14) 0 1px 1px 0, rgba(0, 0, 0, 0.12) 0 1px 3px 0;
    background-color: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    margin: 0;
}

.app-grid figure figcaption {
    margin: 0.5rem;
    max-height: 6.35lh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.app-grid figure :is(h4, p) {
    margin: 0.5rem 0;
}

.app-grid figure h4 {
    font-weight: normal;
}

.app-grid figure p {
    margin-bottom: 0;
    font-size: 0.7em;
    opacity: 0.7;
}

.app-grid figure img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: white;
    display: block;
}

#debug-panel {
    width: min(96vw, 88rem);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem;
    border: 1px solid var(--perle);
    border-radius: 0.5rem;
}

#debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.debug-actions > button,
#reload-apps-btn {
    margin-top: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#debug-header h2 {
    margin: 0;
}

#reload-apps-btn {
    margin-top: 0;
    white-space: nowrap;
}

.debug-actions > button,
#reload-apps-btn {
    min-height: 2.5rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#instances-totals {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    margin: 0.5rem 0 0.75rem 0;
}

#instances-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#instances-table th,
#instances-table td {
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: top;
}

#instances-table td {
    overflow-wrap: anywhere;
}

#toasts {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.toast {
    background: #2d2d2d;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(0.5rem); }
    to   { opacity: 1; transform: translateY(0); }
}

#build-status {
    background: #f4f4f4;
    border-left: 3px solid #888;
    padding: 0.5rem 0.8rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

#builds-table {
    border-collapse: collapse;
}

#builds-table th,
#builds-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
}
