/* Source sync uses the existing platform modal and monochrome row buttons. */
.platform-modal-card.wide:has(.gallery-sync-shell){width:min(1120px,94vw)}
.platform-modal-card.wide:has(.gallery-sync-editor){width:min(800px,94vw)}
.platform-modal-body:has(.gallery-sync-shell){padding:30px 32px 24px;scrollbar-gutter:stable}
.gallery-sync-shell{font-size:14px;line-height:1.6;min-width:0;color:#171717}
.gallery-sync-shell h2,.gallery-sync-shell h3,.gallery-sync-shell p{margin:0}
.gallery-sync-shell small{font-size:12px;color:#81817c;line-height:1.6}
.gallery-sync-shell .row-btn{font:inherit;font-size:13px;line-height:1.4;min-height:38px;padding:9px 14px;border-radius:10px;border-color:#deded9;white-space:nowrap;flex-shrink:0}
.gallery-sync-shell .row-btn.primary-dark{background:#171717;color:white;border-color:#171717}
.gallery-sync-shell .row-btn:hover:not(:disabled){background:#eeeeea}
.gallery-sync-shell .row-btn.primary-dark:hover:not(:disabled){background:#333}
.gallery-sync-shell .row-btn:disabled{background:#efefeb;color:#92928c;cursor:not-allowed;border-color:#e6e6e1}
.gallery-sync-shell button:focus-visible,.gallery-sync-shell input:focus-visible{outline:2px solid #171717;outline-offset:3px}
.sync-page-head{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:2px 44px 24px 0}
.sync-page-head h2{font-size:25px;font-weight:650;letter-spacing:-.03em;margin:5px 0 8px}
.sync-page-head p{font-size:13px;color:#77776f;line-height:1.7}
.sync-eyebrow{font-size:11px;letter-spacing:.06em;color:#92928a}
.sync-account{display:flex;align-items:center;gap:18px;border:1px solid #e3e3dd;background:#fff;padding:20px 22px;border-radius:16px}
.sync-account-icon{display:grid;place-items:center;width:48px;height:48px;flex-shrink:0;background:#f3f3ef;border-radius:14px;color:#66665e}
.sync-account-icon svg{width:25px;height:25px}
.sync-account-copy{min-width:0;flex:1}
.sync-account-title{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.sync-account-title>b{font-size:15px}
.sync-account-copy p{font-size:13px;color:#595953;margin-bottom:3px}
.sync-badge{display:inline-flex;align-items:center;border:1px solid #dfdfd7;background:#f2f2eb;color:#5f5f52;font-size:11px;line-height:1.4;padding:4px 9px;border-radius:6px;white-space:nowrap;font-weight:400}
.sync-badge.muted{border-color:#e9e9e5;background:#f6f6f3;color:#85857c}
.sync-summary{display:flex;align-items:center;gap:24px;padding:19px 2px;color:#76766f;font-size:12px;flex-wrap:wrap}
.sync-summary b{font-size:17px;color:#20201c;font-weight:600;margin-right:4px;font-variant-numeric:tabular-nums}
.sync-summary span:last-child{margin-left:auto;color:#92928a}
.sync-tabs{display:flex;gap:26px;border-bottom:1px solid #deded8;overflow-x:auto}
.sync-tabs button{position:relative;display:flex;gap:8px;align-items:center;border:0;background:none;padding:12px 0 16px;color:#8a8a81;cursor:pointer;font:inherit;font-size:14px;white-space:nowrap}
.sync-tabs button.active{font-weight:600;color:#181816}
.sync-tabs button.active:after{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;border-radius:2px;background:#171717}
.sync-tabs button span{display:grid;place-items:center;min-width:21px;padding:0 5px;font-size:11px;font-weight:400;border-radius:5px;background:#eaeae5;color:#73736b}
.sync-content{padding-top:18px;min-height:200px}
.sync-source-list{border:1px solid #e3e3dd;background:#fff;border-radius:14px;overflow:hidden}
.sync-source-row{display:grid;grid-template-columns:minmax(180px,1fr) 130px 128px auto;align-items:center;gap:18px;padding:20px;border-bottom:1px solid #ecece7}
.sync-source-row:last-child{border-bottom:0}
.sync-source-name{display:flex;align-items:center;gap:12px;min-width:0}
.sync-source-name>div{min-width:0}
.sync-source-name b,.sync-discovered-card b{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.sync-avatar{display:grid;place-items:center;flex-shrink:0;width:38px;height:38px;border:1px solid #e7e7df;border-radius:12px;background:#f6f6f1;font-size:15px;color:#68685e}
.sync-source-name small,.sync-plan small,.sync-source-state small,.sync-discovered-card small{display:block;margin-top:4px}
.sync-url{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-size:11px!important}
.sync-plan b{font-size:12px;font-weight:500}
.sync-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.sync-source-row .row-btn{font-size:12px;min-height:34px;padding:7px 10px}
.sync-section-note{font-size:12px;color:#85857c;padding:0 0 16px}
.sync-discovered-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.sync-discovered-card{display:flex;gap:12px;align-items:center;padding:18px;background:#fff;border:1px solid #e3e3dd;border-radius:14px;min-width:0}
.sync-discovered-card>div{flex:1;min-width:0}
.sync-run-list{background:#fff;border:1px solid #e3e3dd;border-radius:14px;overflow:hidden}
.sync-run-row{display:flex;gap:15px;align-items:flex-start;padding:20px 22px;border-bottom:1px solid #ecece7}
.sync-run-row:last-child{border-bottom:0}
.sync-run-dot{width:7px;height:7px;border-radius:50%;background:#a0a096;margin-top:10px;flex-shrink:0}
.sync-run-row>div{min-width:0;flex:1}
.sync-run-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.sync-run-title b{font-size:14px;overflow-wrap:anywhere}
.sync-run-row p{font-size:13px;color:#6b6b62;margin:8px 0 6px;overflow-wrap:anywhere}
.sync-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:42px 24px;color:#6c6c63;background:#fff;border:1px dashed #ddddd5;border-radius:14px;min-height:210px}
.sync-empty svg{width:32px;height:32px;color:#a3a397;margin-bottom:4px}
.sync-empty b{font-size:15px;color:#505047;font-weight:500}
.sync-empty p{font-size:13px;color:#919187;max-width:440px}
.sync-empty .row-btn{margin-top:6px}
.sync-form{margin:0}
.sync-form-section{background:#fff;border:1px solid #e3e3dd;border-radius:15px;padding:22px 24px;margin-bottom:16px}
.sync-form-section h3{font-size:14px;font-weight:600;margin-bottom:20px}
.sync-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 24px}
.sync-field{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:13px;color:#55554e;margin:0}
.sync-field-wide{grid-column:1/-1}
.sync-field small{font-size:11px}
.gallery-sync-shell .xui-inline-input{display:block;width:100%;min-width:0;min-height:44px;border:1px solid #deded7;border-radius:10px;background:#fafaf8;color:#20201c;padding:11px 13px;font:inherit;font-size:14px;box-shadow:none;outline:none}
.gallery-sync-shell .xui-inline-input::placeholder{color:#aeaea3;font-size:13px}
.gallery-sync-shell .xui-inline-input:focus{border-color:#20201c;box-shadow:0 0 0 2px #20201c12}
.sync-frequency{padding:0;border:0;display:block}
.sync-frequency legend{padding:0;margin-bottom:8px;font-size:13px;color:#55554e}
.sync-frequency-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.sync-frequency-options label{position:relative;cursor:pointer;min-width:0}
.sync-frequency-options input{position:absolute;opacity:0;width:1px;height:1px}
.sync-frequency-options span{display:grid;place-items:center;min-height:44px;background:#fafaf8;border:1px solid #deded7;border-radius:9px;font-size:12px;white-space:nowrap}
.sync-frequency-options input:checked+span{background:#20201c;border-color:#20201c;color:#fff}
.sync-frequency-options input:focus-visible+span{outline:2px solid #171717;outline-offset:3px}
.sync-frequency>small{display:block;margin-top:8px}
.sync-date-wrap{min-width:0;display:block}
.sync-date-wrap input{height:44px}
.sync-enable{position:relative;display:flex;align-items:center;gap:20px;border-top:1px solid #ededE7;margin-top:22px;padding-top:20px;cursor:pointer}
.sync-enable>span:first-child{flex:1;min-width:0}
.sync-enable b{display:block;font-size:13px;font-weight:500;margin-bottom:3px}
.sync-enable small{display:block;font-size:11px}
.sync-enable input{position:absolute;right:0;opacity:0;width:42px;height:24px;margin:0}
.sync-switch{display:block;position:relative;flex-shrink:0;width:42px;height:24px;border:1px solid #cfcfc5;border-radius:999px;background:#dfdfd6;transition:background .15s}
.sync-switch:after{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0002;transition:transform .15s}
.sync-enable input:checked+.sync-switch{background:#22221d;border-color:#22221d}
.sync-enable input:checked+.sync-switch:after{transform:translateX(18px)}
.sync-enable input:focus-visible+.sync-switch{outline:2px solid #171717;outline-offset:3px}
.sync-form-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 0 0}
.sync-form-footer>span{font-size:11px;color:#96968c}
.sync-form-footer .row-btn{min-width:92px;min-height:42px}
.sync-error{color:#a12b25;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.sync-error:empty{display:none}
.sync-error:not(:empty){margin:16px 0!important;padding:12px 14px;border:1px solid #edd9d5;border-radius:10px;background:#fff7f5}
@media(max-width:1050px){.sync-source-row{grid-template-columns:minmax(180px,1fr) 130px 130px}.sync-source-row .sync-actions{grid-column:1/-1;justify-content:flex-end;padding-top:8px;border-top:1px solid #f0f0eb}.sync-account{align-items:flex-start}.sync-account .row-btn{align-self:center}}
@media(max-width:650px){.platform-modal-body:has(.gallery-sync-shell){padding:26px 18px 20px}.sync-page-head{padding-right:30px;gap:12px;align-items:flex-start;flex-direction:column}.sync-page-head h2{font-size:22px}.sync-account{display:grid;grid-template-columns:38px minmax(0,1fr);padding:16px;gap:12px}.sync-account-icon{width:38px;height:38px}.sync-account>.row-btn{grid-column:2;justify-self:start}.sync-summary{gap:12px}.sync-summary span:last-child{width:100%;margin-left:0}.sync-tabs{gap:20px}.sync-source-row{grid-template-columns:1fr 1fr;padding:16px;gap:16px}.sync-source-name{grid-column:1/-1}.sync-source-row .sync-actions{justify-content:flex-start}.sync-discovered-grid{grid-template-columns:1fr}.sync-discovered-card{padding:14px}.sync-form-section{padding:20px 16px}.sync-form-grid{grid-template-columns:1fr;gap:20px}.sync-field-wide{grid-column:auto}.sync-form-footer{align-items:stretch;flex-direction:column}.sync-form-footer>.sync-actions{justify-content:flex-end}.sync-form-footer>span{display:none}.sync-form-footer .row-btn{flex:1}.sync-run-row{padding:16px}.sync-empty{padding:30px 16px}}
@media(prefers-reduced-motion:reduce){.sync-switch,.sync-switch:after{transition:none}}
.sync-switch{pointer-events:none}
.sync-form-section:first-child .sync-field{grid-column:1/-1}.sync-form-footer{position:sticky;bottom:-24px;z-index:2;padding:16px 0 0;background:#f7f7f5;border-top:1px solid #e3e3dd}@media(max-width:650px){.sync-form-footer{bottom:-20px;padding:12px 0 0}}
.sync-form-footer{bottom:-12px;padding-bottom:8px}@media(max-width:650px){.sync-form-footer{bottom:-8px;padding-bottom:8px}}

.sync-bulk-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;flex-wrap:wrap}.sync-bulk-toolbar .sync-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.sync-bulk-toolbar [role=status]{color:#777;font-size:13px}.sync-source-name .sync-album-check,.sync-batch-date-choice input{appearance:none;-webkit-appearance:none;position:relative;width:22px;height:22px;min-width:22px;flex:0 0 22px;margin:0 8px 0 0;border:1.5px solid #bbb;border-radius:6px;background:#fff;cursor:pointer}.sync-source-name .sync-album-check:checked,.sync-batch-date-choice input:checked{border-color:#111;background:#111}.sync-source-name .sync-album-check:checked:after,.sync-batch-date-choice input:checked:after{content:'';position:absolute;left:5px;top:4px;width:9px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg)}.sync-source-name .sync-album-check:focus-visible,.sync-batch-date-choice input:focus-visible{outline:2px solid #555;outline-offset:3px}.sync-batch-date-choice{display:flex;align-items:center;gap:8px;margin:20px 0 12px;color:#333;font-size:14px}.gallery-sync-shell [hidden]{display:none!important}.sync-source-row:has(.sync-album-check:checked){background:#f5f5f2}@media(max-width:600px){.sync-bulk-toolbar{align-items:stretch}.sync-bulk-toolbar>.primary-dark{width:100%}.sync-source-name .sync-avatar{display:none}.sync-source-name .sync-album-check{margin-right:2px}}

.sync-manual-progress{padding:18px 20px;margin:0 0 20px;border:1px solid #e3e3df;border-radius:16px;background:#fff}.sync-manual-progress-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.sync-manual-progress p,.sync-manual-progress summary{font-size:13px;color:#777;line-height:1.7;overflow-wrap:anywhere}.sync-manual-progress progress{width:100%;height:7px;accent-color:#222;margin:4px 0 12px}.sync-page-head>.sync-actions{flex-wrap:wrap}
