* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0f172a;
    color: #e2e8f0;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    padding: 24px;
    min-height: 100vh;
}

header {
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

header .subtitle {
    color: #94a3b8;
    margin-top: 4px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 8px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-left: 4px solid #475569;
    border-radius: 8px;
    padding: 20px;
    min-width: 220px;
    flex: 1 1 240px;
}

.card.at-chair {
    border-left-color: #22c55e;
}

.card.away {
    border-left-color: #475569;
}

.card-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-status {
    font-size: 15px;
    margin-bottom: 6px;
}

.card-time {
    font-size: 13px;
    color: #94a3b8;
}

.card-location {
    margin-top: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.loading {
    color: #94a3b8;
}

nav {
    margin-top: 12px;
}

.btn {
    display: inline-block;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.btn:hover {
    background-color: #24334a;
}

.btn.primary {
    background-color: #22c55e;
    border-color: #22c55e;
    color: #052e14;
    font-weight: 600;
}

.btn.primary:hover {
    background-color: #26d968;
}

.badge {
    background-color: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.preview-panel {
    flex: 1 1 280px;
    max-width: 420px;
    background-color: #000;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
}

.btn.remove {
    margin-left: 12px;
    padding: 3px 10px;
    font-size: 12px;
    border-color: #7f1d1d;
    background-color: #450a0a;
    color: #fca5a5;
}

.btn.remove:hover {
    background-color: #7f1d1d;
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

#self-view {
    display: block;
    max-width: 640px;
    max-height: 360px;
    /* The raw front-camera image is a mirror of reality; the mirrored stream
       the receiver sees matches how a person looks at themselves, and this
       selfie mirror keeps the phone's own preview identical to that view. */
    transform: scaleX(-1);
}

.preview-label {
    background-color: #1e293b;
    color: #94a3b8;
    font-size: 13px;
    padding: 8px 12px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-panel img {
    display: block;
    width: 100%;
    height: auto;
}

.preview-note {
    color: #94a3b8;
    font-size: 12px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    color: #cbd5e1;
    margin-bottom: 6px;
    font-size: 14px;
}

.field input,
.field select {
    width: 100%;
    max-width: 360px;
    padding: 10px 12px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
}

.status {
    margin-top: 16px;
    padding: 12px 16px;
    background-color: #1e293b;
    border-left: 4px solid #22c55e;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    min-height: 20px;
}

.link-copy {
    margin-top: 16px;
}

.link-label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 8px;
}

.link-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#link-uri {
    color: #22c55e;
    font-family: Consolas, monospace;
    word-break: break-all;
}

.link-status {
    margin-top: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    background-color: #1e293b;
    border: 1px solid #475569;
    color: #94a3b8;
}

.pill.live {
    background-color: #14532d;
    border-color: #22c55e;
    color: #bbf7d0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

th {
    background-color: #1e293b;
    color: #94a3b8;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 14px;
}

tr:hover {
    background-color: #24334a;
}
