/*
 * The iframe mirrors the original board's visual contract in a dedicated
 * stylesheet so customer-page CSS cannot leak in and portal JS is unnecessary.
 */
:root {
    color-scheme: light;
    font-family: Avenir, Helvetica, Arial, sans-serif;
    color: #091e42;
    background: #ffffff;
    font-synthesis: none;
    --embed-brand-color: #0065ff;
    --embed-accent-color: #0052cc;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 0;
    margin: 0;
    background: #ffffff;
}

body {
    color: #091e42;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--embed-accent-color);
    font-weight: 500;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    border-radius: 4px;
    outline: 3px solid #b3d4ff;
    outline-offset: 3px;
}

.embed-board {
    width: 100%;
    max-width: 691px;
    min-width: 0;
    margin: 0 auto;
    padding: 0 24px 18px;
}

/* Reuse the portal's 40px logo and 26px wordmark proportions. */
.embed-brand-header {
    position: sticky;
    z-index: 4;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 84px;
    padding: 21px 0 13px;
    background: rgba(255, 255, 255, 0.97);
}

.embed-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    color: var(--embed-brand-color);
    font-size: 26px;
    font-weight: 500;
    line-height: 39px;
    text-decoration: none;
}

.embed-brand:hover {
    color: var(--embed-accent-color);
    text-decoration: none;
}

.embed-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.embed-company-logo {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    margin-right: 10px;
    object-fit: contain;
}

.embed-company-logo-rounded {
    border-radius: 50%;
}

.embed-open-link {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #dfe1e6;
    border-radius: 5px;
    color: #505f79;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
}

.embed-open-link:hover {
    border-color: var(--embed-accent-color);
    color: var(--embed-accent-color);
    text-decoration: none;
}

/* Match the board title and compact dotted sorting control from the portal. */
.embed-board-toolbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    min-height: 69px;
    padding: 0 0 10px;
}

.embed-board-toolbar h1 {
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 15px 10px 20px 0;
    color: #505f79;
    font-size: 20px;
    font-weight: 400;
    line-height: 24px;
}

.embed-sorting {
    position: relative;
    top: 17px;
    flex: 0 0 auto;
    color: #091e42;
    font-size: 15px;
    line-height: 22px;
}

.embed-sorting summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border-bottom: 1px dashed #c1c7d0;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.embed-sorting summary::-webkit-details-marker {
    display: none;
}

.embed-sorting summary span {
    position: relative;
    top: -1px;
    color: #a5adba;
    font-size: 17px;
}

.embed-sorting[open] summary {
    color: var(--embed-accent-color);
}

.embed-sorting nav {
    position: absolute;
    z-index: 5;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    min-width: 150px;
    overflow: hidden;
    padding: 5px 0;
    border: 1px solid #ebecf0;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(9, 30, 66, 0.16);
}

.embed-sorting nav a {
    position: relative;
    padding: 7px 14px 7px 34px;
    color: #253858;
    font-size: 14px;
    text-decoration: none;
}

.embed-sorting nav a:hover {
    color: var(--embed-accent-color);
    background: #f4f5f7;
}

.embed-sorting nav a[aria-current="page"]::before {
    position: absolute;
    left: 14px;
    content: "✓";
    color: var(--embed-accent-color);
}

/*
 * The original create field remains visually familiar, but it is an explicit
 * escape hatch because only the narrower vote action is permitted in-frame.
 */
.embed-create-prompt {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -10px 0 25px;
    padding: 11px 14px;
    border: 1px solid #dfe1e6;
    border-radius: 5px;
    color: #7a869a;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
}

.embed-create-prompt:hover {
    border-color: var(--embed-accent-color);
    color: #505f79;
    text-decoration: none;
}

.embed-create-prompt-action {
    flex: 0 0 auto;
    color: var(--embed-accent-color);
    font-size: 13px;
    font-weight: 600;
}

.embed-vote-status {
    margin: -12px 0 18px;
    padding: 8px 10px;
    border-radius: 5px;
    color: #42526e;
    background: #f4f5f7;
    font-size: 13px;
    line-height: 1.4;
}

/* An empty live region should not introduce visual whitespace before posts. */
.embed-vote-status:empty {
    display: none;
}

.embed-posts {
    display: block;
    padding: 0 0 8px;
}

/* Flat rows, rather than standalone cards, preserve the original board rhythm. */
.embed-post {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 75px;
    margin: 0 0 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.embed-voting-box {
    display: flex;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 55px;
    max-height: 55px;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ebecf0;
    border-radius: 5px;
    color: #091e42;
    background: #ffffff;
    font: inherit;
    padding: 0;
    text-align: center;
}

.embed-voting-box-interactive {
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease,
        opacity 120ms ease;
}

.embed-voting-box-interactive:hover {
    border-color: var(--embed-accent-color);
    background: #f7faff;
}

.embed-voting-box-interactive:hover .embed-vote-arrow,
.embed-voting-box-interactive.is-voted .embed-vote-arrow {
    color: var(--embed-accent-color);
}

.embed-voting-box-interactive.is-voted {
    border-color: var(--embed-accent-color);
    background: #f4f9ff;
}

.embed-voting-box-interactive.is-pending {
    opacity: 0.55;
}

.embed-voting-box-interactive:disabled {
    cursor: default;
}

.embed-vote-arrow {
    height: 27px;
    color: #c1c7d0;
    font-size: 22px;
    line-height: 30px;
}

.embed-voting-box strong {
    display: block;
    width: 40px;
    overflow: hidden;
    color: #091e42;
    font-size: 18px;
    font-weight: 400;
    line-height: 25px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.embed-post-content {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 0 0 12px;
    color: #091e42;
    text-decoration: none;
}

.embed-post-content:hover {
    color: #42526e;
    text-decoration: none;
}

.embed-post-title-row {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.embed-post h2 {
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 0;
    padding-top: 1px;
    color: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.embed-comments {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    padding-top: 2px;
    color: #8993a4;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
}

.embed-comment-icon {
    position: relative;
    display: inline-block;
    width: 13px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
}

.embed-comment-icon::after {
    position: absolute;
    bottom: -4px;
    left: 2px;
    width: 4px;
    height: 4px;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    background: #ffffff;
    content: "";
    transform: skewY(-35deg);
}

.embed-status {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    margin: 3px 5px 2px 0;
    padding: 4px 8px 2px;
    border: 1px solid #a5adba;
    border-radius: 5px;
    color: #5e6c84;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.embed-post p {
    display: -webkit-box;
    overflow: hidden;
    margin: 2px 0 0;
    color: #172b4d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.embed-post-meta {
    min-height: 23px;
    margin-top: 10px;
    padding-bottom: 5px;
    color: #7a869a;
    font-size: 13px;
    line-height: 18px;
}

.embed-empty {
    padding: 38px 0 48px 54px;
    color: #6b778c;
}

.embed-empty h2 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 500;
}

.embed-empty p {
    margin: 0;
    font-size: 14px;
}

.embed-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 4px 0 20px 54px;
    color: #7a869a;
    font-size: 13px;
    text-align: center;
}

.embed-pagination a,
.embed-pagination > span:first-child,
.embed-pagination > span:last-child {
    padding: 6px 9px;
    border: 1px solid #dfe1e6;
    border-radius: 5px;
    text-decoration: none;
}

.embed-pagination a:first-child,
.embed-pagination > span:first-child {
    justify-self: start;
}

.embed-pagination a:last-child,
.embed-pagination > span:last-child {
    justify-self: end;
}

.embed-pagination [aria-disabled="true"] {
    opacity: 0.55;
}

.embed-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0 0 54px;
    border-top: 1px solid #ebecf0;
    color: #7a869a;
    font-size: 12px;
}

.embed-footer a {
    flex: 0 0 auto;
    text-decoration: none;
}

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

@media (max-width: 576px) {
    .embed-board {
        padding: 0 16px 14px;
    }

    .embed-brand-header {
        min-height: 70px;
        gap: 12px;
        padding: 14px 0 10px;
    }

    .embed-brand {
        font-size: 22px;
        line-height: 32px;
    }

    .embed-company-logo {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        margin-right: 8px;
    }

    .embed-open-link {
        padding: 6px 8px;
        font-size: 12px;
    }

    .embed-board-toolbar {
        min-height: 62px;
    }

    .embed-board-toolbar h1 {
        margin: 13px 8px 17px 0;
        font-size: 19px;
    }

    .embed-sorting {
        top: 14px;
        font-size: 14px;
    }

    .embed-sorting nav {
        min-width: 142px;
    }

    .embed-create-prompt {
        margin-top: -8px;
        margin-bottom: 18px;
    }

    .embed-post {
        margin-bottom: 10px;
        padding: 10px 0;
    }

    .embed-post-content {
        padding-left: 10px;
    }

    .embed-post h2 {
        font-size: 17px;
    }

    .embed-pagination,
    .embed-footer {
        padding-left: 52px;
    }

    .embed-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 380px) {
    .embed-brand span {
        max-width: 150px;
    }

    .embed-open-link {
        white-space: nowrap;
    }

    /* Keep a complete action label instead of clipping "Open board". */
    .embed-open-label-extra {
        display: none;
    }

    .embed-create-prompt-action {
        font-size: 12px;
    }

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

    .embed-pagination > span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}
