/* The PXP web client: FluentUI's components and tokens, with a little layout of its own. */

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--fontFamilyBase, "Segoe UI", system-ui, sans-serif);
    background: var(--colorNeutralBackground2, #f5f5f5);
    color: var(--colorNeutralForeground1, #242424);
}

h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
h1:focus { outline: none; }

.header {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
}

/* FluentUI paints the header area in the brand colour; a neutral bar keeps the presence buttons and text readable. */
.fluent-layout-item[area="header"] {
    background: var(--colorNeutralBackground1, #fff);
    color: var(--colorNeutralForeground1, #242424);
    border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0);
}

.account { color: var(--colorNeutralForeground3, #616161); }
.presence-picker { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.status-form { display: inline-flex; }
.signout { margin: 0; }
.header .signout { margin-left: auto; } /* FluentSpacer doesn't stretch inside a plain flex row */

.content { padding: 1rem 1.5rem; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }

.nav-entry { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; }
.nav-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread {
    min-width: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--colorBrandBackground, #0f6cbd);
    color: var(--colorNeutralForegroundOnBrand, #fff);
    font-size: 0.75rem;
    text-align: center;
}

.conversation-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.conversation-header h1 { margin: 0; }

.conversation { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0.75rem; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.25rem; min-height: 12rem; }
.message {
    max-width: min(36rem, 80%);
    padding: 0.45rem 0.7rem;
    border-radius: 0.6rem;
    background: var(--colorNeutralBackground1, #fff);
    box-shadow: var(--shadow2, 0 1px 2px rgba(0, 0, 0, 0.12));
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-wrap: anywhere;
}
.message.mine { align-self: flex-end; background: var(--colorBrandBackground2, #ebf3fc); }
.message.theirs { align-self: flex-start; }
.message.sending { opacity: 0.7; }
.message.failed { outline: 1px solid var(--colorPaletteRedBorder2, #d13438); }
.message .sender { font-weight: 600; font-size: 0.85rem; }
.message .meta { font-size: 0.75rem; color: var(--colorNeutralForeground3, #616161); }

.composer { display: flex; gap: 0.5rem; align-items: center; }
.composer > :nth-child(2) { flex: 1; }
.composer .attach { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.25rem; border: 1px dashed var(--colorNeutralStroke1, #d1d1d1); border-radius: 4px; cursor: pointer; font-size: 1.1rem; }
.composer .attach input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; } /* files dropped on the clip go to the input */
.chosen { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; padding: 0.25rem 0; }
.chip { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--colorNeutralBackground3, #f0f0f0); }
.attachments { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.25rem 0; }
.attachment-image img { max-width: 240px; max-height: 240px; width: auto; height: auto; border-radius: 4px; display: block; }
.attachment-video { max-width: 320px; max-height: 240px; border-radius: 4px; }
.attachment-audio { max-width: 320px; }
.attachment-file { display: inline-block; padding: 0.35rem 0.6rem; border: 1px solid var(--colorNeutralStroke2, #e0e0e0); border-radius: 4px; text-decoration: none; }
.attachment-file.pending { opacity: 0.6; }
.quote { display: block; font-size: 0.8rem; border-left: 3px solid var(--colorBrandStroke1, #0f6cbd); padding: 0.1rem 0.4rem; margin-bottom: 0.2rem; color: var(--colorNeutralForeground2, #424242); }
.text.deleted { font-style: italic; color: var(--colorNeutralForeground3, #616161); }
.reactions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.2rem 0; }
.reaction { border: 1px solid var(--colorNeutralStroke2, #e0e0e0); border-radius: 999px; background: transparent; padding: 0 0.45rem; cursor: pointer; font-size: 0.85rem; }
.reaction.mine { border-color: var(--colorBrandStroke1, #0f6cbd); background: var(--colorBrandBackground2, #ebf3fc); }
.message .actions { display: none; gap: 0.15rem; }
.message:hover .actions, .message:focus-within .actions { display: inline-flex; }
.action { border: none; background: transparent; cursor: pointer; padding: 0 0.2rem; font-size: 0.9rem; }

.section { margin-bottom: 1rem; padding: 1rem; }
.row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.25rem 0; }
.grow { flex: 1; min-width: 12rem; }
.problem { margin-bottom: 0.75rem; color: var(--colorPaletteRedForeground1, #bc2f32); }

/* The sign-in and not-found pages: static, without FluentUI's scripts. */
.plain { display: flex; justify-content: center; padding: 10vh 1rem; }
.signin { width: min(34rem, 100%); background: var(--colorNeutralBackground1, #fff); padding: 1.5rem; border-radius: 0.5rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.signin form { display: flex; flex-direction: column; gap: 0.5rem; }
.signin textarea { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; padding: 0.5rem; }
.signin button { align-self: flex-start; padding: 0.45rem 1.2rem; border: none; border-radius: 0.3rem; background: #0f6cbd; color: #fff; cursor: pointer; }
.signin code { overflow-wrap: anywhere; }

@media (prefers-color-scheme: dark) {
    html, body { background: #1f1f1f; color: #f0f0f0; }
    .signin, .message { background: #2b2b2b; }
    .fluent-layout-item[area="header"] { background: #292929; color: #f0f0f0; border-bottom-color: #3d3d3d; }
    .message.mine { background: #0f3a63; }
}

/* Photos (milestone M33). */
.stack { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.feed { display: flex; flex-direction: column; gap: 1.25rem; max-width: 36rem; padding-bottom: 2rem; }
.post { background: var(--colorNeutralBackground1, #fff); border-radius: 0.5rem; box-shadow: var(--shadow2, 0 1px 2px rgba(0, 0, 0, 0.12)); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.post-author { display: flex; align-items: center; gap: 0.5rem; }
.post-photos { display: grid; gap: 0.25rem; }
.post-photos.several { grid-template-columns: repeat(2, 1fr); }
.post-photos img { width: 100%; height: auto; border-radius: 0.3rem; display: block; }
.caption { margin: 0; overflow-wrap: anywhere; }
.post-page { max-width: 40rem; display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 2rem; }
.comments { display: flex; flex-direction: column; gap: 0.35rem; }
.comment { margin: 0; overflow-wrap: anywhere; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.large { width: 5rem; height: 5rem; }
.avatar.initial { display: inline-flex; align-items: center; justify-content: center; background: var(--colorBrandBackground2, #ebf3fc); font-weight: 600; }
.avatar.large.initial { font-size: 2rem; }
.profile { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.profile h1 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.25rem; max-width: 48rem; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.stories { display: flex; gap: 0.75rem; overflow-x: auto; padding: 0.25rem 0 0.75rem; }
.story { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; border: none; background: none; cursor: pointer; font: inherit; color: inherit; max-width: 5rem; }
.story img { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; outline: 2px solid var(--colorBrandStroke1, #0f6cbd); outline-offset: 2px; }
.story span { font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 5rem; }
.story.open img { outline-width: 3px; }
.story-view { margin: 0 0 1rem; max-width: 36rem; }
.story-view img { width: 100%; border-radius: 0.5rem; display: block; }
.person { border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0); }

@media (prefers-color-scheme: dark) {
    .post { background: #2b2b2b; }
    .avatar.initial { background: #0f3a63; }
}

/* Profiles (milestone M34). */
.banner { width: 100%; max-width: 48rem; max-height: 12rem; object-fit: cover; border-radius: 0.5rem; display: block; margin-bottom: 0.75rem; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--colorBrandBackground2, #ebf3fc); color: var(--colorBrandForeground1, #0f6cbd); vertical-align: middle; }
.company { margin: 0.15rem 0; font-weight: 600; }
.nav-entry .avatar { width: 1.25rem; height: 1.25rem; font-size: 0.7rem; }

/* Read state, typing, mentions and voice notes (milestone M39). */
.typing { font-size: 0.8rem; color: var(--colorNeutralForeground3, #616161); padding: 0.1rem 0.5rem; font-style: italic; }
.read-mark { color: var(--colorBrandForeground1, #0f6cbd); }
.delivered-mark { color: var(--colorNeutralForeground3, #707070); }
.load-older { display: block; margin: 0 auto 0.75rem; background: none; border: 1px solid var(--colorNeutralStroke1, #d1d1d1); border-radius: 4px; padding: 0.25rem 0.75rem; cursor: pointer; }
.request-note { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: 4px; background: var(--colorNeutralBackground3, #f5f5f5); }
.message.mentioned { box-shadow: inset 3px 0 0 var(--colorPaletteMarigoldBorderActive, #c19c00); }
.voice-note { display: block; font-size: 0.8rem; color: var(--colorNeutralForeground2, #424242); }
.record { border: none; background: transparent; cursor: pointer; font-size: 1.1rem; padding: 0 0.3rem; }
.record.on { color: var(--colorPaletteRedForeground1, #bc2f32); }

/* The account pages (decision 630): sign-in with a password, registration, the account itself. */
.signin input, .signin select { padding: 0.45rem 0.5rem; border: 1px solid var(--neutral-stroke-rest, #ccc); border-radius: 0.3rem; font: inherit; }
.signin .joined { display: flex; align-items: center; gap: 0.35rem; }
.signin .joined input { flex: 1; min-width: 0; }
.signin .alternative { margin-top: 0.75rem; }
.signin .notice { margin-bottom: 0.75rem; color: var(--colorPaletteGreenForeground1, #107c10); }
.account-section { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin: 1.25rem 0; max-width: 32rem; }
.account-section.danger h2 { color: var(--colorPaletteRedForeground1, #bc2f32); }
.signin button.passkey { background: transparent; color: #0f6cbd; border: 1px solid #0f6cbd; }
.account-section .passkey-row { display: flex; align-items: center; gap: 0.75rem; }
