/*
 * The owner console (modul/platform), on theme.css's variables and IBM Plex: white sheets on the cool desk, inked in
 * Roomday's fixed navy (--accent), which fills only the primary button (white text on --accent-strong) and otherwise
 * shows as edge lines and link text. The console shows no account colour at all. Panels are theme.css's .bd-card and
 * statuses its .bd-chip. One column from 375px up, no horizontal scroll: the accounts table stacks below 760px.
 */

.pc {
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
    overflow-wrap: break-word;
}

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

.pc-wrap {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 16px;
}

.pc a {
    color: var(--accent-strong);
    text-underline-offset: 2px;
}

.pc a:hover {
    color: var(--ink);
}

.pc a:focus-visible,
.pc button:focus-visible,
.pc input:focus-visible,
.pc select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Bar ---------- */

.pc-bar {
    background: var(--sheet);
    border-bottom: 1px solid var(--rule);
}

.pc-bar-in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    min-height: 56px;
}

.pc .pc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
}

/* The mark: a navy room outline with a door gap, as on the landing page. */
.pc-brand::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 3px solid var(--accent);
    border-right-color: transparent;
    border-radius: 4px;
}

.pc-brand-area {
    font-weight: 500;
    color: var(--ink-2);
    padding-left: 10px;
    border-left: 1px solid var(--rule);
}

.pc-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    font-size: .95rem;
}

/* The user menu: a button with the picture (or the initials on a neutral desk tone, never a person's colour) and the
   name, and below it a sheet with the email, the language, the picture's actions and "Log out". */
.pc-menu {
    position: relative;
}

.pc .pc-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 4px 8px 4px 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}

.pc .pc-menu-button:hover,
.pc .pc-menu-button[aria-expanded="true"] {
    border-color: var(--rule);
    background: var(--desk);
}

.pc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.pc-initials {
    background: var(--desk);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.pc-user {
    color: var(--ink-2);
}

.pc-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    min-width: 15rem;
    max-width: calc(100vw - 32px);
    padding: 6px 0;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: var(--r-control);
    box-shadow: 0 8px 24px rgba(27, 37, 51, .12);
}

.pc-menu-list[hidden] {
    display: none;
}

.pc-menu-email {
    margin: 0;
    padding: 6px 14px 8px;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink-2);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.pc-menu-form {
    margin: 0;
}

.pc .pc-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.pc .pc-menu-item:hover,
.pc .pc-menu-item:focus-within {
    background: var(--desk);
    color: var(--ink);
}

/* The file input stays focusable and in the accessibility tree; its label is the menu item. */
.pc-file {
    position: relative;
}

.pc-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.pc-file:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.pc-menu-form .pc-error {
    margin: 0 14px 6px;
}

/* On a narrow screen the button keeps the picture; the name is there for assistive technology only. */
@media (max-width: 520px) {
    .pc-menu-button .pc-user {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.pc .pc-link {
    border: 0;
    background: none;
    padding: 4px 0;
    font: inherit;
    font-weight: 500;
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.pc .pc-link:hover {
    color: var(--ink);
}

/* ---------- Page ---------- */

.pc-main {
    padding-top: 24px;
    padding-bottom: 48px;
}

.pc h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
}

.pc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 20px;
}

.pc-hint {
    margin: 6px 0 0;
    font-size: .92rem;
    color: var(--ink-2);
}

.pc-muted {
    color: var(--ink-2);
    font-size: .9em;
}

.pc-notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--free);
    border-radius: var(--r-control);
}

.pc-error {
    margin: 8px 0 0;
    padding-left: 10px;
    border-left: 3px solid var(--stop);
    color: var(--ink);
    font-size: .95rem;
}

.pc-error[hidden] {
    display: none;
}

/* ---------- Controls ---------- */

.pc .pc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid var(--accent-strong);
    border-radius: var(--r-control);
    background: var(--accent-strong);
    color: #FFFFFF;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.pc .pc-button:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #FFFFFF;
}

.pc .pc-button:disabled {
    opacity: .6;
    cursor: progress;
}

.pc-field {
    margin: 0 0 16px;
}

.pc-field:last-child {
    margin-bottom: 0;
}

.pc .pc-field label {
    display: block;
    margin: 0 0 6px;
    font-size: .95rem;
    font-weight: 500;
    color: var(--ink);
}

.pc-field input,
.pc-field select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--field-border);
    border-radius: var(--r-control);
    background: var(--sheet);
    color: var(--ink);
    font: inherit;
    /* 16px: a smaller field makes iOS Safari zoom in on focus. */
    font-size: 16px;
}

.pc-field input[aria-invalid="true"],
.pc-address:has(input[aria-invalid="true"]) {
    border-color: var(--stop);
}

/* The slug and the base domain read as one address: demo-kool.roomday.app. */
.pc-address {
    display: flex;
    align-items: center;
    background: var(--sheet);
    border: 1px solid var(--field-border);
    border-radius: var(--r-control);
}

.pc-address:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.pc .pc-address input {
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    padding-right: 4px;
}

.pc .pc-address input:focus-visible {
    outline: none;
}

.pc-suffix {
    flex: 0 0 auto;
    padding: 0 12px 0 0;
    color: var(--ink-2);
    white-space: nowrap;
}

.pc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 20px;
}

/* ---------- Panels (theme.css .bd-card) ---------- */

.pc .bd-card {
    background: var(--sheet);
}

.pc-create .bd-card + .bd-card {
    margin-top: 16px;
}

.pc .bd-card-body {
    padding: 16px;
}

/* ---------- Sign in ---------- */

.pc-signin {
    max-width: 26rem;
    margin: 24px auto 0;
}

.pc-signin h1 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.pc-signin .pc-form {
    margin-top: 16px;
}

.pc-signin .pc-button {
    width: 100%;
    margin-top: 8px;
}

.pc-back {
    margin: 12px 0 0;
    text-align: center;
}

.pc-qr {
    display: block;
    width: 184px;
    height: 184px;
    margin: 16px auto 8px;
    border: 1px solid var(--rule);
    border-radius: var(--r-control);
}

.pc-key {
    margin: 0;
    text-align: center;
    font-size: .92rem;
    color: var(--ink-2);
}

.pc-secret {
    font-size: 1rem;
    color: var(--ink);
    letter-spacing: .04em;
    overflow-wrap: anywhere;
}

/* ---------- Accounts ---------- */

.pc-create {
    max-width: 40rem;
}

.pc-accounts {
    width: 100%;
    border-collapse: collapse;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: var(--r-panel);
    overflow: hidden;
    font-size: .95rem;
}

.pc-accounts th {
    padding: 10px 12px;
    background: var(--desk);
    color: var(--ink-2);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--rule);
}

.pc-accounts td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: middle;
}

.pc-accounts tbody tr:last-child td {
    border-bottom: 0;
}

.pc-accounts td[data-col="name"] {
    font-weight: 500;
}

.pc-accounts .pc-num,
.pc-accounts .pc-col-rooms,
.pc-accounts .pc-col-members {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Over the tier's room limit (after a downgrade): a line, not a fill. */
.pc-accounts .pc-over {
    box-shadow: inset 3px 0 0 var(--warn);
    color: var(--ink);
    font-weight: 600;
}

@media (max-width: 760px) {
    .pc-accounts thead {
        display: none;
    }

    .pc-accounts,
    .pc-accounts tbody,
    .pc-accounts tr,
    .pc-accounts td {
        display: block;
        width: 100%;
    }

    .pc-accounts tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--rule);
    }

    .pc-accounts tbody tr:last-child {
        border-bottom: 0;
    }

    .pc-accounts td,
    .pc-accounts tbody tr:last-child td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 4px 12px;
        border: 0;
    }

    .pc-accounts td::before {
        content: attr(data-label);
        color: var(--ink-2);
        font-size: .85rem;
    }

    .pc-accounts .pc-num {
        text-align: left;
    }
}

/* ---------- Sections, account, tiers, audit ---------- */

.pc .pc-section {
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.pc .pc-section[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.pc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: -8px 0 20px;
}

.pc-lead {
    margin: -8px 0 16px;
}

.pc .pc-section-card {
    margin-bottom: 16px;
}

.pc-usage,
.pc-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 12px 24px;
    margin: 0 0 8px;
}

.pc-usage dt,
.pc-facts dt {
    color: var(--ink-2);
    font-size: .85rem;
}

.pc-usage dd,
.pc-facts dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.pc-usage dd {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Over a limit (after a downgrade): a line, not a fill. */
.pc-usage .pc-over {
    padding-left: 8px;
    box-shadow: inset 3px 0 0 var(--warn);
}

.pc-features {
    margin: 8px 0 20px;
    font-size: .92rem;
}

.pc-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0 16px;
}

.pc-checks {
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 4px 16px;
}

.pc-checks legend {
    margin: 0 0 6px;
    padding: 0;
    font-size: .95rem;
    font-weight: 500;
}

.pc-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 32px;
    font-size: .95rem;
}

.pc-check input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--accent-strong);
}

.pc-check-wide {
    margin-top: 16px;
}

/* A feature that differs from the chosen tier: a word with an edge line, never a fill. */
.pc-diff {
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid var(--rule);
    border-radius: var(--r-control);
    color: var(--ink-2);
    font-size: .82rem;
    white-space: nowrap;
}

.pc-diff[hidden] {
    display: none;
}

.pc .pc-button-quiet {
    background: var(--sheet);
    color: var(--accent-strong);
}

.pc .pc-button-quiet:hover {
    background: var(--desk);
    color: var(--ink);
}

.pc-people {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pc-person {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.pc-person:last-child {
    border-bottom: 0;
}

.pc-person-who {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    min-width: 0;
}

.pc-person-do {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.pc-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
}

.pc-said {
    font-size: .9rem;
    color: var(--ink-2);
}

.pc-correct summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-size: .95rem;
}

.pc-correct .pc-form {
    margin-top: 8px;
    max-width: 24rem;
}

.pc-scroll {
    width: 100%;
    overflow-x: auto;
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--sheet);
    font-size: .92rem;
}

.pc-table th,
.pc-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--rule-soft);
    text-align: left;
    vertical-align: middle;
}

.pc-table thead th {
    background: var(--desk);
    color: var(--ink-2);
    font-size: .8rem;
    font-weight: 600;
    border-bottom: 1px solid var(--rule);
}

.pc-tiers {
    border: 1px solid var(--rule);
    min-width: 40rem;
}

.pc-tiers tbody th {
    font-weight: 500;
    white-space: nowrap;
}

.pc .pc-cell {
    width: 100%;
    min-width: 6rem;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--field-border);
    border-radius: var(--r-control);
    background: var(--sheet);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

.pc-tick {
    text-align: center;
}

.pc-tick input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-strong);
}

.pc-unenforced {
    display: block;
    color: var(--ink-2);
    font-size: .8rem;
    font-weight: 400;
    white-space: normal;
}

.pc-audit {
    border: 1px solid var(--rule);
    min-width: 48rem;
}

.pc-nowrap {
    white-space: nowrap;
}

.pc-detail {
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.pc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Imports ---------- */
.pc-imports {
    border: 1px solid var(--rule);
    min-width: 40rem;
}

/* A turned-off import, and the warning of "Replace the account": the edge line says it, the text stays ink. */
.pc-notice-off,
.pc-warning {
    border-left-color: var(--warn);
}

.pc-warning {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--rule);
    border-left: 4px solid var(--warn);
    border-radius: var(--r-control);
    background: var(--sheet);
}

.pc-import input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 8px 0;
    font: inherit;
}

.pc-upload {
    margin: 16px 0 0;
}

.pc-upload[hidden],
.pc-progress[hidden] {
    display: none;
}

.pc-upload-bar {
    width: 100%;
    height: 10px;
    accent-color: var(--accent-strong);
}

.pc-upload-text,
.pc-progress {
    margin: 6px 0 0;
    font-variant-numeric: tabular-nums;
}

.pc-progress {
    margin: -8px 0 12px;
    padding-left: 10px;
    border-left: 3px solid var(--warn);
}

.pc-facts-line {
    margin: 0 0 16px;
    color: var(--ink-2);
}

.pc-run + .pc-error {
    margin: 0 0 16px;
}

.pc-report {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.pc-counts {
    border: 1px solid var(--rule);
    min-width: 24rem;
}

.pc-counts th[scope="row"] {
    font-weight: 400;
}

.pc-counts .pc-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pc-details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
}

.pc-json {
    max-height: 32rem;
    margin: 12px 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--rule);
    border-radius: var(--r-control);
    background: var(--desk);
    color: var(--ink);
    font-size: .8rem;
    white-space: pre;
}
