/* ===== AMPER MEDIA (ammedia.js) ===== */

:root[data-theme="cyberpunk"] #ammedia-window {
    --pv-hi: #484f58;
}

/* --- the window --- */
#ammedia-window {
    --pv-hi: var(--white, #fff);
    --kp-hi: var(--pv-hi);     /* the Win98 checkbox (.kp-check) of the site uses it */
}

#ammedia-window.visible {
    display: flex;
    flex-direction: column;
}

#ammedia-window > .window-header,
#ammedia-window > .window-menu-bar {
    flex-shrink: 0;
}

#ammedia-window [hidden] {
    display: none !important;
}

.window-content.am-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 6px 3px;
    overflow: hidden;
    box-sizing: border-box;
}

.am-tabs {
    flex-shrink: 0;
}

.am-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
}

.am-page .adm-table-wrap {
    flex: 1 1 auto;
    min-height: 60px;
}

.am-table td {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-table td.am-title {
    width: 100%;
    max-width: 0;
    min-width: 120px;
}

.am-table td:nth-child(3) {
    white-space: nowrap;      /* the site lets column 3 wrap (Status in the admin list) */
}

.am-sortable th {
    cursor: pointer;
    user-select: none;
}

.am-sortable th:active {
    box-shadow: inset 1px 1px var(--window-border-dark), inset -1px -1px var(--pv-hi);
}

.am-sortable th.am-sorted::after {
    content: ' ' attr(data-arrow);
    font-size: 8px;
    vertical-align: 1px;
}

.am-check {
    flex-shrink: 0;
    white-space: nowrap;
}

.am-table tr.am-rejected td {
    color: #808080;
}

.am-table tr.selected.am-rejected td {
    color: #d0d0d0;
}

.am-piccell {
    width: 30px;
    padding: 1px 4px !important;
}

.am-poster {
    display: block;
    width: 28px;
    height: 40px;
    object-fit: cover;
    background: var(--window-border-dark);
}

.am-barcell {
    min-width: 90px;
}

.am-bar {
    position: relative;
    height: 14px;
    width: 88px;
    color: var(--text-color);
    background: var(--white, #fff);
    border: 1px solid;
    border-color: var(--window-border-dark) var(--pv-hi, #fff) var(--pv-hi, #fff) var(--window-border-dark);
}

.am-bar-fill {
    height: 100%;
    background: var(--active-titlebar-start);
    opacity: 0.45;
}

.am-bar span {
    position: absolute;
    inset: 0;
    text-align: center;
    line-height: 13px;
}

.am-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.am-field input {
    flex: 1;
    min-width: 0;
    height: 21px;
    padding: 1px 4px;
    box-sizing: border-box;
    font-family: 'MS Sans Serif', Tahoma, sans-serif;
    font-size: 11px;
    color: #000;
    background: #fff;
    border: 2px solid;
    border-color: var(--window-border-dark) var(--pv-hi, #fff) var(--pv-hi, #fff) var(--window-border-dark);
}

.am-logon {
    margin: auto;
    padding: 18px;
    max-width: 320px;
    text-align: center;
    line-height: 1.5;
}

.am-logon-icon {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
}

.am-logon .pv-btn {
    margin-top: 10px;
}

/* the release chooser sits on top of the tabs */
.am-rel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.am-rel .adm-table-wrap {
    flex: 1 1 auto;
    min-height: 80px;
}

.am-rel-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.am-rel-title {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-note {
    flex-shrink: 0;
    color: var(--text-color);
}

/* --- overview --- */
.am-overview {
    gap: 5px;
    overflow: auto;
}

.am-row {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}

.am-row > fieldset,
.am-disk {
    min-width: 0;
    padding: 2px 7px 6px;
}

.am-box {
    flex: 1 1 0;
}

.am-speed {
    flex: 0 0 128px;
}

.am-graph {
    flex: 1 1 0;
}

.am-overview legend {
    font-size: 11px;
}

.am-caption {
    margin: 3px 0 2px;
}

.am-lcd {
    height: 36px;
    box-sizing: border-box;
    padding: 0 7px;
    line-height: 32px;
    text-align: right;
    font-family: 'Lucida Console', Monaco, monospace;
    font-size: 15px;
    color: #00ff00;
    background: #000;
    border: 2px solid;
    border-color: var(--window-border-dark) var(--pv-hi) var(--pv-hi) var(--window-border-dark);
    white-space: nowrap;
    overflow: hidden;
}

.am-lcd-up {
    color: #ffff00;
}

.am-graph .canvas-container {
    display: block;
    height: 108px;
    overflow: hidden;
}

.am-graph canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.am-graph-legend {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 3px;
    font-size: 11px;
}

.am-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 4px;
    vertical-align: -1px;
    border: 1px solid #000;
}

.am-key-down { background: #00ff00; }
.am-key-up { background: #ffff00; }
.am-key-used { background: #0000ff; }
.am-key-free { background: #ff00ff; }

.am-progress-text {
    margin: 2px 0 3px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-chunks {
    height: 18px;
    box-sizing: border-box;
    padding: 2px;
    background: var(--white, #fff);
    border: 2px solid;
    border-color: var(--window-border-dark) var(--pv-hi) var(--pv-hi) var(--window-border-dark);
}

.am-chunks-fill {
    width: 0;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--active-titlebar-start) 0 9px, transparent 9px 11px);
    transition: width 0.4s linear;
}

.am-facts {
    width: 100%;
    margin-top: 4px;
    border-collapse: collapse;
    font-size: 11px;
}

.am-facts td,
.am-facts th {
    padding: 1px 0;
    font-weight: normal;
    white-space: nowrap;
}

.am-facts td:not(:first-child),
.am-facts th:not(:first-child) {
    text-align: right;
    padding-left: 8px;
}

.am-stats th {
    border-bottom: 1px solid var(--window-border-dark);
}

.am-ratio {
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid var(--window-border-dark);
    box-shadow: inset 0 1px 0 var(--pv-hi);
}

.am-disk {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.am-disk legend {
    float: none;
}

.am-disk .am-facts {
    width: 210px;
    flex-shrink: 0;
    margin: 0;
}

.am-disk canvas {
    flex-shrink: 0;
}

.am-disk .am-cap td {
    padding-top: 4px;
    border-top: 1px solid var(--window-border-dark);
}

.am-disk-pct {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
}

@media (max-width: 768px) {
    #ammedia-window .pv-btn {
        min-height: 34px;
    }

    .am-table td {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .am-row {
        flex-direction: column;
    }

    .am-row > fieldset {
        flex: 0 0 auto;
    }

    .am-speed {
        display: flex;
        gap: 6px;
    }

    .am-speed-cell {
        flex: 1 1 0;
        min-width: 0;
    }

    .am-disk {
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .am-disk-pct {
        flex: 0 0 100%;
    }
}
