/* Base layout and palette carried over from the Brassica pipeline page. */

html {
    font-family: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
}
body {
    margin: 0px;
    padding: 10px;
    display: flex;
    flex-flow: column nowrap;
    gap: 10px;
    min-height: 100vh;
    box-sizing: border-box;
}
h1 {
    padding: 0px;
    margin: 0px;
}
details {
    border: 1px solid #aaa;
    border-radius: 4px;
    padding: 0.5em 0.5em 0;
    max-width: 90vw;
}
summary {
    font-weight: bold;
    margin: -0.5em -0.5em 0;
    padding: 0.5em;
}
details[open] {
    padding: 0.5em;
}
details[open] > summary {
    border-bottom: 1px solid #aaa;
    margin-bottom: 0.5em;
}
details p:first-of-type {
    margin-top: 0px;
}
details p:last-of-type {
    margin-bottom: 0px;
}
form {
    flex: 1 1 auto;
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    background-color: #f3f3f3;
    padding: 1rem;
    min-height: 10%;
    gap: 10px;
}
.box-container {
    flex-flow: column nowrap;
    display: flex;
    justify-content: start;
    align-items: flex-start;
    border: #bdcbe1 1px solid;
    min-height: 0;
}
#plan-div, #log-div {
    flex: 1 1 0;
    min-width: 0;
}
.header {
    background-color: #e1e7f1;
    border-bottom: #bdcbe1 1px solid;
    width: 100%;
    box-sizing: border-box;
    padding: 0.2rem;
}
.header label {
    font-weight: bold;
}
.header .file-buttons {
    margin-left: 1rem;
}
.hidden-file-input {
    display: none;
}
.input-box {
    flex: 1 1 auto;
    width: 100%;
    font: inherit;
    font-size: 90%;
    overflow: auto;
    background-color: #fff;
    box-sizing: border-box;
    min-height: 0;
}
#controls {
    padding: 0 5px;
    display: flex;
    flex-flow: column nowrap;
    gap: 5px;
    min-width: 15em;
    max-width: 18em;
    overflow: auto;
}
#controls input[type="submit"], #controls input[type="button"], #controls select {
    font: inherit;
}
#controls input[type="submit"] {
    font-weight: bold;
    padding: 0.35em;
}
#controls fieldset {
    border: #bdcbe1 1px solid;
    margin: 0;
    padding: 0.4em 0.6em 0.6em;
}
#controls fieldset legend {
    font-weight: bold;
    font-size: 90%;
}
#controls fieldset .stack {
    display: flex;
    flex-flow: column nowrap;
    gap: 4px;
    align-items: stretch;
}
code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
    font-size: 92%;
    background-color: #f3f3f3;
    padding: 0 0.2em;
    border-radius: 2px;
}

/* ---- setup plan ------------------------------------------------- */

#plan {
    padding: 0;
}
.section {
    border: none;
    border-bottom: 1px solid #e1e7f1;
    border-radius: 0;
    padding: 0;
    max-width: none;
}
.section:last-child {
    border-bottom: none;
}
.section > summary {
    margin: 0;
    padding: 0.45em 0.6em;
    color: #35507a;
    background-color: #fafbfd;
    cursor: pointer;
}
.section[open] {
    padding: 0;
}
.section[open] > summary {
    border-bottom: 1px solid #e1e7f1;
    margin-bottom: 0;
}
.section > summary:focus-visible {
    outline: 2px solid #35507a;
    outline-offset: -2px;
}
.section-count {
    font-weight: normal;
    color: #6b7c99;
    margin-left: 0.4em;
}
.section-body {
    padding: 0.5em 0.6em 0.7em;
}
.section-intro {
    margin: 0 0 0.5em 0;
    color: #444;
}
.note {
    color: #6b7c99;
    font-size: 92%;
}

/* Sequential on-phone instructions really are a sequence, so they keep
   their numbers. */
ol.steps {
    margin: 0;
    padding-left: 1.6em;
}
ol.steps li {
    margin-bottom: 0.3em;
}
ol.steps li:last-child {
    margin-bottom: 0;
}
ul.items {
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.items li {
    margin-bottom: 0.25em;
}
label.check {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
}
label.check input[type="checkbox"], label.check input[type="radio"] {
    flex: none;
    position: relative;
    top: 0.15em;
}
label.check.done > .check-text {
    color: #6b7c99;
    text-decoration: line-through;
}
.pkg {
    color: #6b7c99;
}
.row-actions {
    margin-left: auto;
    padding-left: 0.6em;
    flex: none;
    white-space: nowrap;
}

/* ---- badges and per-task status --------------------------------- */

.badge {
    font-size: 84%;
    padding: 0 0.35em;
    border-radius: 3px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-present  { color: #35507a; border-color: #bdcbe1; background: #f5f9ff; }
.badge-absent   { color: #6b7c99; border-color: #dfe4ec; background: #f7f8fa; }
.badge-ok       { color: #1a7f37; border-color: #b6dcc0; background: #f1faf3; }
.badge-fail     { color: #a3111c; border-color: #e6bcc0; background: #fdf4f5; }
.badge-skip     { color: #8a6d0b; border-color: #e3d7a6; background: #fdfaef; }
.badge-running  { color: #35507a; border-color: #bdcbe1; background: #eef3fb; }

.apk-row {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    flex-wrap: wrap;
}
.apk-file {
    color: #35507a;
}
.apk-file.empty {
    color: #6b7c99;
    font-style: italic;
}
.release-row {
    margin-top: 0.15em;
}
.release-line {
    flex: 1 1 auto;
    min-width: 12em;
}
.release-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}
.release-actions select {
    font: inherit;
    font-size: 90%;
    max-width: 14em;
}

/* A link styled as a button: the download has to be a real navigation, since
   GitHub's asset host sends no CORS headers and fetch() would be blocked. */
a.button-link {
    font-size: 90%;
    padding: 0.1em 0.6em;
    border: 1px solid #bdcbe1;
    border-radius: 3px;
    background-color: #e1e7f1;
    color: #35507a;
    text-decoration: none;
    white-space: nowrap;
}
a.button-link:hover {
    background-color: #d3dceb;
}
a.button-link:focus-visible {
    outline: 2px solid #35507a;
    outline-offset: 1px;
}

/* ---- log -------------------------------------------------------- */

#log {
    font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
    font-size: 85%;
    padding: 0.4em;
    white-space: pre-wrap;
    word-break: break-word;
}
.log-line {
    padding: 0.05em 0;
}
.log-time {
    color: #93a1b8;
    margin-right: 0.5em;
}
.log-cmd  { color: #35507a; }
.log-ok   { color: #1a7f37; }
.log-fail { color: #a3111c; }
.log-skip { color: #8a6d0b; }
.log-note { color: #555; }
#log .empty {
    color: #93a1b8;
    font-family: inherit;
}

/* ---- controls --------------------------------------------------- */

#device {
    margin-bottom: 0.4em;
}
#device .device-name {
    font-weight: bold;
    color: #35507a;
    word-break: break-word;
}
#device.off {
    color: #6b7c99;
}
#status {
    font-size: 92%;
    color: #35507a;
}
#status.error {
    color: #a3111c;
}
progress {
    width: 100%;
    height: 0.8em;
}

/* ---- narrow windows --------------------------------------------- */

@media (max-width: 800px) {
    form {
        flex-flow: column nowrap;
    }
    #controls {
        max-width: none;
        overflow: visible;
    }
    #plan-div, #log-div {
        flex: none;
    }
    #plan, #log {
        max-height: 60vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
