:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f1f4f9;

    --border: #e5e9f2;

    --text: #0f172a;
    --muted: #64748b;

    --primary: #0b6ea8;
    --primary-2: #0a5f91;
    --primary-3: #074a71;

    --shadow:
        0 2px 4px rgba(0,0,0,.04),
        0 8px 24px rgba(0,0,0,.06);

    --shadow-2:
        0 4px 12px rgba(0,0,0,.08);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --permitted: #2cff05;
    --denied: #ff2c2c;

    --ring: 0 0 0 4px rgba(11,110,168,.15);

    --mono:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    --sans:
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial;
}

/* =========================================
   BASE
========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family: var(--sans);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================
   TOPBAR
========================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 10px 18px;
}

.left {
    display: flex;
    align-items: center;
}

.right {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img {
    display: block;
    height: 60px;
    width: auto;
}

/* first logo originally had inline style */
.brand a:first-child img {
    height: 50px;
}

#logo img {
    width: 200px;
    height: auto;
    display: block;
}

/* =========================================
   CONTAINER
========================================= */

.container {
    width: 100%;
    max-width: 1800px;

    margin: 0 auto;
    padding: 16px;
}

/* =========================================
   GRID LAYOUT
========================================= */

.grid {
    display: grid;

    grid-template-columns:
        minmax(280px, 340px)
        minmax(0, 1fr);

    gap: 16px;

    align-items: start;
}

/* =========================================
   CARDS
========================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
    display: flex;
    flex-direction: column;

    gap: 16px;

    padding: 16px;

    width: 100%;
    min-width: 0;
}

/* =========================================
   VIDEO CARD
========================================= */

.canvas-card {
    display: flex;
    flex-direction: column;

    min-width: 0;

    padding: 16px;
}

/* =========================================
   LABEL BAR
========================================= */

.labels {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(120px, 1fr));

    gap: 12px;

    padding: 12px 16px;

    margin-bottom: 14px;

    border-radius: 12px;

    background: var(--primary-2);
}

.label-item {
    display: flex;
    flex-direction: column;

    min-width: 0;

    font-weight: 600;
}

.label-title {
    color: white;

    font-size: 14px;
    font-weight: 900;

    letter-spacing: .04em;
    text-transform: uppercase;
}

.label-item > :nth-child(2) {
    color: var(--border);

    font-size: 14px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#policy,
#classification,
#releasability {
    white-space: nowrap;
}

#access.granted {
    color: var(--permitted);
}

#access.denied {
    color: var(--denied);
}

/* =========================================
   CANVAS
========================================= */

.canvas-wrapper {
    width: 100%;
}

canvas {
    display: block;

    width: 100%;
    height: auto;

    aspect-ratio: 4 / 3;

    max-width: 100%;

    background: #000;

    border-radius: 12px;
}

/* =========================================
   MAP
========================================= */

#map {
    width: 100%;

    aspect-ratio: 1;

    min-height: 260px;

    border-radius: 12px;

    overflow: hidden;
}

/* =========================================
   TABLE
========================================= */

.table {
    width: 100%;

    border-collapse: collapse;
    table-layout: auto;

    font-size: 13px;
}

.table td {
    padding: 8px;

    border-bottom: 1px solid var(--border);

    vertical-align: center;
}
td.colon-space {
    width: 5%;
}
.table td:first-child {
    width: 35%;
}


.section-title {
    padding: 12px 8px;

    font-size: 12px;
    font-weight: 900;

    letter-spacing: .08em;
    text-transform: uppercase;

    color: var(--text);
}

.title-cell {
    font-weight: 900;
    color: var(--muted);

}
.meta-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50px;
}

/* =========================================
   CONTROLS
========================================= */

.stream-controls {
    display: flex;

    justify-content: space-between;
    align-items: stretch;

    gap: 12px;

    margin-top: 16px;

    flex-wrap: wrap;
}

.stream-left,
.stream-right {
    flex: 1;

    display: flex;
}

/* =========================================
   BUTTONS
========================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
.buttons {
    flex: 1;

    display: flex;
}
.confirm {
    background: #28a745;
    color: white;
    border: none;
    display: inline-flex;

    justify-content: center;
    align-items: center;

    gap: 10px;

    min-height: 48px;
    width: 100%;

    padding: 12px 16px;

    border-radius: 10px;
    border: 1px solid var(--border);

    cursor: pointer;

    font-weight: 700;

    transition:
        background .2s,
        box-shadow .2s,
        transform .1s;
}
.confirm:hover{
    cursor: pointer;
}
.cancel {
    background: #dc3545;
    color: white;
    border: none;
    display: inline-flex;

    justify-content: center;
    align-items: center;

    gap: 10px;

    min-height: 48px;
    width: 100%;

    padding: 12px 16px;

    border-radius: 10px;
    border: 1px solid var(--border);

    cursor: pointer;

    font-weight: 700;

    transition:
        background .2s,
        box-shadow .2s,
        transform .1s;
}
.cancel:hover {
    cursor: pointer;
}
.btn {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    gap: 10px;

    min-height: 48px;
    width: 100%;

    padding: 12px 16px;

    border-radius: 10px;
    border: 1px solid var(--border);

    cursor: pointer;

    font-weight: 700;

    transition:
        background .2s,
        box-shadow .2s,
        transform .1s;
}

.btn:hover {
    box-shadow: var(--shadow-2);
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background: var(--primary);
    color: white;

    border: none;
}

.btn.primary:hover {
    background: var(--primary-2);
}

/* =========================================
   PLAYTIME
========================================= */

.playtime {
    min-width: 120px;

    text-align: center;

    font-size: 1.25rem;
    font-weight: 700;
}

/* =========================================
   USER MENU
========================================= */

.dropdown {
    position: relative;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 10px;

    border-radius: var(--radius-pill);

    border: 1px solid var(--border);

    background: var(--surface);

    cursor: pointer;
}

.user-pill:hover {
    box-shadow: var(--shadow-2);
}

.avatar {
    width: 34px;
    height: 34px;

    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            rgba(11,110,168,.25),
            rgba(11,110,168,.05)
        );

    border: 1px solid rgba(11,110,168,.25);
}

.menu {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    min-width: 210px;

    display: none;

    padding: 8px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 14px;

    box-shadow: var(--shadow);
}

.menu.open {
    display: block;
}

.menu a,
.menu button {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    text-align: left;

    cursor: pointer;

    color: var(--text);

    font-weight: 600;
}

.menu a:hover,
.menu button:hover {
    background: var(--surface-2);
}

.menu .sep {
    height: 1px;

    margin: 6px;

    background: var(--border);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1366px) {

    .container {
        padding: 12px;
    }

    .brand img {
        height: 50px;
    }

    .brand a:first-child img {
        height: 42px;
    }

    #logo img {
        width: 160px;
    }

    .label-title {
        font-size: 12px;
    }

    .label-item > :nth-child(2) {
        font-size: 13px;
    }

    .table {
        font-size: 12px;
    }
}

@media (max-width: 1100px) {

    .grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .canvas-card {
        order: 1;
    }

    .labels {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {

    .topbar-inner {
        flex-wrap: wrap;
    }

    .labels {
        grid-template-columns: 1fr;
    }

    .stream-left,
    .stream-right {
        flex: 100%;
    }

    .brand img {
        height: 40px;
    }

    .brand a:first-child img {
        height: 34px;
    }

    #logo img {
        width: 120px;
    }
}