:root {
    --pm-sync-green-950: #073d36;
    --pm-sync-green-900: #0a4f45;
    --pm-sync-green-800: #06695d;
    --pm-sync-green-700: #007a6b;
    --pm-sync-green-600: #0b8f7e;
    --pm-sync-green-100: #e7f6f1;
    --pm-sync-green-50: #f4fbf8;
    --pm-sync-ink: #123f38;
    --pm-sync-muted: #637a75;
    --pm-sync-border: #d7e6e2;
    --pm-sync-surface: #ffffff;
    --pm-sync-page: #f6faf9;
    --pm-sync-shadow: 0 14px 34px rgba(31, 77, 68, .07);
}

/* Shared app-distribution primitives used by download/offline pages. */
.pm-app-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 64px;
    color: #173f38;
    font: 16px/1.6 system-ui, sans-serif;
}
.pm-app-hero {
    text-align: center;
    padding: 48px 24px;
    border-radius: 28px;
    background: linear-gradient(140deg, #e4f5ed, #f5faf8);
    margin-bottom: 24px;
}
.pm-app-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; margin: 16px 0; }
.pm-app-hero > p { max-width: 760px; margin: 16px auto; }
.pm-app-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; }
.pm-app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; margin: 24px 0; }
.pm-app-card { border: 1px solid #cce2d9; border-radius: 18px; padding: 24px; background: #fff; margin-bottom: 16px; }
.pm-app-card h2 { font-size: 1.25rem; margin-top: 0; }
.pm-app-card[data-recommended] { border: 2px solid #006b5e; }
.pm-app-card[data-recommended]::before { content: "For this device"; font-size: .8rem; color: #006b5e; font-weight: 700; }
.pm-app-button { display: inline-block; background: #006b5e; color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.pm-app-button:disabled { opacity: .6; cursor: default; }
[hidden] { display: none !important; }
.pm-app-page a { color: #006b5e; }
.pm-app-page button:focus-visible,
.pm-app-page a:focus-visible,
.pm-app-page select:focus-visible { outline: 3px solid #dc9700; outline-offset: 3px; }
.pm-app-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pm-app-page select { padding: 10px; max-width: 100%; font: inherit; }
.pm-app-device { overflow-wrap: anywhere; font-size: .85rem; }

/* Sync Center standalone shell. */
.pm-sync-standalone {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--pm-sync-ink);
    background:
        radial-gradient(circle at 83% 0%, rgba(208, 239, 230, .48), transparent 28rem),
        linear-gradient(180deg, #fbfdfc 0%, var(--pm-sync-page) 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pm-sync-topbar {
    min-height: 70px;
    padding: 0 max(24px, calc((100vw - 1380px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid #e4edeb;
    box-shadow: 0 5px 20px rgba(29, 74, 66, .04);
    backdrop-filter: blur(12px);
}
.pm-sync-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #103d36;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.02em;
    text-decoration: none;
}
.pm-sync-brand img { width: 34px; height: 34px; border-radius: 8px; }
.pm-sync-topbar__actions { display: flex; align-items: center; gap: 8px; }
.pm-sync-topbar__actions a,
.pm-sync-topbar__actions button {
    min-height: 40px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3c5a54;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.pm-sync-topbar__actions a:hover,
.pm-sync-topbar__actions button:hover { background: #f0f7f5; color: var(--pm-sync-green-800); }
.pm-sync-topbar__actions .pm-sync-topbar__install {
    padding-inline: 18px;
    color: #fff;
    background: linear-gradient(180deg, #087c6c 0%, #006b5e 100%);
    box-shadow: 0 7px 18px rgba(0, 107, 94, .14);
}
.pm-sync-topbar__actions .pm-sync-topbar__install:hover { color: #fff; background: #005f54; }

/* Sync Center page. */
.pm-sync-page {
    --pm-sync-radius: 14px;
    --pm-sync-ink: #103c3d;
    --pm-sync-muted: #6c7992;
    --pm-sync-border: #dbe4ee;
    --pm-sync-shadow: 0 4px 18px rgba(30, 63, 85, .025);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1280px;
    padding-top: 22px;
}
.owner-sync-page.pm-sync-page { max-width: 100%; }
.pm-sync-page *,
.pm-sync-topbar * { box-sizing: border-box; }
.pm-sync-page svg,
.pm-sync-topbar svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pm-sync-breadcrumbs {
    min-height: 44px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #708681;
    font-size: .88rem;
    font-weight: 650;
}
.pm-sync-breadcrumbs a { color: var(--pm-sync-green-700); text-underline-offset: 3px; }
.pm-sync-breadcrumbs > span[aria-hidden="true"] { color: #a7b8b4; font-size: 1.2rem; }
.pm-sync-breadcrumbs > span[aria-current="page"] { color: #58716b; }
.pm-sync-breadcrumb-action {
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid #c8dcd6;
    border-radius: 9px;
    background: #fff;
    text-decoration: none;
}

.pm-sync-hero {
    min-height: 238px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr);
    overflow: hidden;
    background: linear-gradient(115deg, #f2fbf8 0%, #eef9f5 52%, #e8f7f1 100%);
    border: 1px solid #d5e9e3;
    border-radius: 14px;
    box-shadow: var(--pm-sync-shadow);
}
.pm-sync-hero__content { padding: 36px 0 36px 44px; align-self: center; }
.pm-sync-eyebrow {
    margin: 0 0 9px;
    color: #55746d;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
}
.pm-sync-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.pm-sync-title-row h1 {
    margin: 0;
    color: #113f38;
    font-size: clamp(2.35rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: -.04em;
}
.pm-sync-connectivity {
    min-height: 34px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #506a64;
    background: rgba(255,255,255,.72);
    border: 1px solid #d1e4de;
    border-radius: 999px;
    font-size: .83rem;
    font-weight: 760;
}
.pm-sync-connectivity::before {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #94a9a4;
    box-shadow: 0 0 0 4px rgba(148,169,164,.12);
}
.pm-sync-connectivity[data-state="online"] { color: #145f4f; background: #e7f7f0; border-color: #c8e9dd; }
.pm-sync-connectivity[data-state="online"]::before { background: #0da678; box-shadow: 0 0 0 4px rgba(13,166,120,.12); }
.pm-sync-connectivity[data-state="offline"] { color: #8a4d24; background: #fff6ea; border-color: #f0dcc0; }
.pm-sync-connectivity[data-state="offline"]::before { background: #d5792e; box-shadow: 0 0 0 4px rgba(213,121,46,.12); }
.pm-sync-hero__lead {
    max-width: 690px;
    margin: 18px 0 0;
    color: #203f4b;
    font-size: clamp(.96rem, 1.2vw, 1.04rem);
    line-height: 1.6;
    font-weight: 600;
}
.pm-sync-hero__description { display: block; font-weight: 400; }
.pm-sync-summary {
    margin: 10px 0 0;
    color: #526e76;
    font-size: .86rem;
    font-weight: 650;
}
.pm-sync-hero__visual {
    position: relative;
    min-height: 238px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pm-sync-cloud { position: absolute; background: rgba(190, 230, 218, .48); border-radius: 999px; }
.pm-sync-cloud::before,
.pm-sync-cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.pm-sync-cloud--one { width: 170px; height: 55px; left: 22px; top: 80px; }
.pm-sync-cloud--one::before { width: 78px; height: 78px; left: 34px; bottom: 0; }
.pm-sync-cloud--one::after { width: 55px; height: 55px; right: 16px; bottom: 1px; }
.pm-sync-cloud--two { width: 132px; height: 46px; right: 36px; bottom: 56px; background: rgba(255,255,255,.7); }
.pm-sync-cloud--two::before { width: 62px; height: 62px; left: 16px; bottom: 0; }
.pm-sync-cloud--two::after { width: 48px; height: 48px; right: 12px; bottom: 0; }
.pm-sync-laptop { position: relative; z-index: 2; width: 190px; margin-right: 145px; }
.pm-sync-laptop__screen {
    height: 126px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #f8fffd;
    border: 6px solid #8aaea6;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px #d9ebe6, 0 9px 23px rgba(37,87,78,.1);
}
.pm-sync-laptop__screen svg {
    width: 70px;
    height: 70px;
    padding: 14px;
    background: linear-gradient(145deg, #087967, #0b5249);
    border-radius: 50%;
    stroke-width: 1.7;
}
.pm-sync-laptop__base { width: 216px; height: 10px; margin-left: -13px; background: #7c9f98; border-radius: 0 0 12px 12px; box-shadow: 0 5px 10px rgba(54,93,86,.12); }
.pm-sync-hero__chips {
    position: absolute;
    right: 24px;
    z-index: 3;
    width: 150px;
    display: grid;
    gap: 10px;
}
.pm-sync-hero__chips span {
    min-height: 49px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #365952;
    background: rgba(255,255,255,.9);
    border: 1px solid #e0ece8;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(28,75,66,.06);
    font-size: .78rem;
    font-weight: 700;
}
.pm-sync-hero__chips svg { width: 34px; height: 34px; padding: 7px; color: #006b5e; background: #e7f6f1; border-radius: 10px; flex-shrink: 0; }
.pm-sync-hero__chips::before { content: ""; position: absolute; z-index: -1; width: 38px; height: 116px; top: 25px; left: -38px; border: 1px dashed #8bcbbd; border-right: 0; border-radius: 14px 0 0 14px; }

.pm-sync-device-card {
    margin-top: 16px;
    padding: 24px;
    background: var(--pm-sync-surface);
    border: 1px solid var(--pm-sync-border);
    border-radius: var(--pm-sync-radius);
    box-shadow: var(--pm-sync-shadow);
}
.pm-sync-device-card__main {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(190px, .9fr) auto;
    align-items: center;
    gap: 20px;
}
.pm-sync-device-block { min-width: 0; display: flex; align-items: center; gap: 14px; }
.pm-sync-device-icon {
    width: 62px;
    height: 62px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #0b7567;
    background: #e4f9fb;
    border-radius: 50%;
}
.pm-sync-device-icon svg { width: 24px; height: 24px; }
.pm-sync-device-title { color: #173b46 !important; font-size: 1rem !important; margin-bottom: 12px !important; }
.pm-sync-device-caption { display: block; margin-top: 3px; color: var(--pm-sync-muted); font-size: .85rem; }
.pm-sync-label { display: block; margin-bottom: 3px; color: #65728b; font-size: .74rem; font-weight: 680; }
.pm-sync-device-block strong,
.pm-sync-last-sync strong { display: block; color: #163e37; font-size: .94rem; line-height: 1.35; overflow-wrap: anywhere; }
.pm-sync-last-sync { min-width: 0; padding-left: 20px; border-left: 1px solid #e1ebe8; }
.pm-sync-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.pm-sync-button {
    min-height: 44px;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #b9d0c9;
    border-radius: 7px;
    font: inherit;
    font-size: .84rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.pm-sync-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pm-sync-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(26, 72, 64, .11); }
.pm-sync-button--primary { color: #fff; background: linear-gradient(180deg, #087c6c, #006b5e); border-color: #006b5e; }
.pm-app-page a.pm-sync-button--primary { color: #fff; }
.pm-sync-button--secondary { color: #145c51; background: #fff; }
.pm-app-page a.pm-sync-button--secondary { color: #145c51; }
.pm-sync-button:disabled { opacity: .48; cursor: default; transform: none; box-shadow: none; }
.pm-sync-notice {
    margin-top: 16px;
    padding: 11px 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #775125;
    background: #fff8ee;
    border: 1px solid #f1dfc7;
    border-radius: 11px;
}
.pm-sync-notice__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #ed8900;
    border: 2px solid currentColor;
    background: transparent;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 850;
}
.pm-sync-message,
.pm-sync-notice__detail { margin: 0; }
.pm-sync-message { color: #243648; font-size: .84rem; font-weight: 730; white-space: pre-wrap; }
.pm-sync-notice__detail { margin-top: 1px; color: #65728b; font-size: .76rem; line-height: 1.45; }

.pm-sync-metrics {
    margin: 18px 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}
.pm-sync-metric {
    min-width: 0;
    min-height: 128px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e1ebe8;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(32, 76, 68, .05);
}
.pm-sync-metric__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
}
.pm-sync-metric__icon svg { width: 19px; height: 19px; }
.pm-sync-metric > div { min-width: 0; }
.pm-sync-metric span:not(.pm-sync-metric__icon) { display: block; color: #274c45; font-size: .83rem; font-weight: 750; white-space: nowrap; }
.pm-sync-metric strong { display: block; margin: 12px 0 10px; color: #113f38; font-size: 1.55rem; line-height: 1.1; }
.pm-sync-metric small { display: block; color: #6c7992; font-size: .7rem; line-height: 1.3; }
.pm-sync-metric--pending .pm-sync-metric__icon { color: #3c73c5; background: #edf4ff; }
.pm-sync-metric--syncing .pm-sync-metric__icon { color: #0796ad; background: #e7f9fc; }
.pm-sync-metric--review .pm-sync-metric__icon { color: #d57a16; background: #fff5e7; }
.pm-sync-metric--failed .pm-sync-metric__icon { color: #cf3348; background: #fff0f2; }
.pm-sync-metric--synced .pm-sync-metric__icon { color: #118766; background: #e8f7f1; }

.pm-sync-activity-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pm-sync-border);
    border-radius: var(--pm-sync-radius);
    box-shadow: var(--pm-sync-shadow);
}
.pm-sync-activity-card__header {
    min-height: 82px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e8efed;
}
.pm-sync-activity-card__header > div:first-child { min-width: 0; display: flex; align-items: center; gap: 12px; }
.pm-sync-section-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: #1a5e53; background: #edf8f5; border-radius: 10px; }
.pm-sync-section-icon svg { width: 21px; height: 21px; }
.pm-sync-activity-card h2 { margin: 0; color: #143f38; font-size: 1rem; line-height: 1.25; }
.pm-sync-activity-card__header p { margin: 3px 0 0; color: #6c7992; font-size: .76rem; }
.pm-sync-filter { min-width: 230px; }
.pm-sync-filter label { display: block; margin-bottom: 4px; color: #687f79; font-size: .7rem; font-weight: 700; }
.pm-sync-page .pm-sync-filter select {
    width: 100%;
    min-height: 40px;
    padding: 7px 32px 7px 10px;
    color: #294f48;
    background: #fbfdfc;
    border: 1px solid #cbded8;
    border-radius: 9px;
    font-size: .82rem;
}
.pm-sync-activity-note { padding: 9px 20px; color: #6e847f; background: #fbfdfc; border-bottom: 1px solid #eef3f1; font-size: .75rem; }
.pm-sync-records { min-height: 190px; }
.pm-sync-record {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 18px;
    row-gap: 5px;
    border-top: 1px solid #edf2f0;
    overflow-wrap: anywhere;
}
.pm-sync-record:first-child { border-top: 0; }
.pm-sync-record__heading { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pm-sync-record h3 { margin: 0; color: #173f38; font-size: .9rem; line-height: 1.35; }
.pm-sync-record__status { padding: 3px 7px; color: #44635c; background: #edf6f3; border-radius: 999px; font-size: .65rem; font-weight: 760; }
.pm-sync-record p { grid-column: 1; margin: 0; color: #748985; font-size: .75rem; line-height: 1.45; }
.pm-sync-record a { grid-column: 2; grid-row: 1 / span 3; align-self: center; color: #087463; font-size: .76rem; font-weight: 760; text-decoration: none; }
.pm-sync-record a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pm-sync-empty {
    min-height: 190px;
    padding: 32px 20px;
    display: grid;
    place-items: center;
    text-align: center;
}
.pm-sync-empty__inner { max-width: 420px; }
.pm-sync-empty__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 11px;
    display: grid;
    place-items: center;
    color: #8390a3;
    background: #f4f8f7;
    border: 1px solid #e5edeb;
    border-radius: 13px;
    font-size: 1.35rem;
}
.pm-sync-empty strong { display: block; color: #1e463f; font-size: .9rem; }
.pm-sync-empty p { margin: 4px auto 0; color: #6c7992; font-size: .76rem; }

.pm-sync-footnote {
    margin-top: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #637b75;
    background: rgba(255,255,255,.6);
    border-radius: 11px;
    font-size: .76rem;
    line-height: 1.55;
}
.pm-sync-footnote svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: #3f746a; }
.pm-sync-footnote p { margin: 0; }
.pm-sync-footnote strong { color: #365b54; }

@media (max-width: 1200px) {
    .pm-sync-hero { grid-template-columns: minmax(0, 1fr) 300px; }
    .pm-sync-hero__chips { display: none; }
    .pm-sync-laptop { margin-right: 0; }
    .pm-sync-device-card__main { grid-template-columns: minmax(230px, 1fr) minmax(210px, .85fr); }
    .pm-sync-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 14px; border-top: 1px solid #e6efec; }
    .pm-sync-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .pm-sync-topbar { min-height: auto; padding: 12px 16px; align-items: flex-start; }
    .pm-sync-topbar__actions { justify-content: flex-end; flex-wrap: wrap; }
    .pm-sync-topbar__actions > a:not(.pm-sync-topbar__install) { display: none; }
    .pm-sync-page { padding: 16px 14px 42px; }
    .pm-sync-breadcrumbs { overflow-x: auto; white-space: nowrap; }
    .pm-sync-breadcrumb-action { display: none; }
    .pm-sync-hero { grid-template-columns: 1fr; }
    .pm-sync-hero__content { padding: 28px 24px; }
    .pm-sync-hero__visual { min-height: 175px; border-top: 1px solid #dcece7; }
    .pm-sync-title-row h1 { font-size: clamp(2.35rem, 11vw, 3.2rem); }
    .pm-sync-device-card { padding: 16px; }
    .pm-sync-device-card__main { grid-template-columns: 1fr; gap: 14px; }
    .pm-sync-last-sync { padding: 14px 0 0; border-left: 0; border-top: 1px solid #e6efec; }
    .pm-sync-actions { grid-column: auto; }
    .pm-sync-button { flex: 1 1 190px; }
    .pm-sync-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-sync-activity-card__header { align-items: stretch; flex-direction: column; }
    .pm-sync-filter { min-width: 0; width: 100%; }
    .pm-sync-record { grid-template-columns: 1fr; }
    .pm-sync-record a { grid-column: 1; grid-row: auto; margin-top: 5px; justify-self: start; }
}

@media (max-width: 480px) {
    .pm-sync-brand span { font-size: 1rem; }
    .pm-sync-topbar__install { padding-inline: 12px !important; font-size: .8rem !important; }
    .pm-sync-hero__visual { display: none; }
    .pm-sync-hero__content { padding: 25px 20px; }
    .pm-sync-title-row { align-items: flex-start; flex-direction: column; gap: 10px; }
    .pm-sync-metrics { grid-template-columns: 1fr; }
    .pm-sync-metric { min-height: 96px; }
}

@media (display-mode: standalone) {
    .pm-app-page { padding-top: max(20px, env(safe-area-inset-top)); }
    .pm-sync-topbar { padding-top: env(safe-area-inset-top); }
}

@media (prefers-reduced-motion: reduce) {
    .pm-sync-button { transition: none; }
    .pm-sync-button:not(:disabled):hover { transform: none; }
}
