/* SubSyncer configuration, using the uploaded WIKI's night palette and card system. */
:root {
 color-scheme: dark;
 --bg: #030305; --panel: rgba(16,17,23,.94); --elevated: #1b1d26;
 --line: #3b3e49; --soft-line: #272933; --ink: #f4f4f7; --muted: #aeb2bf;
 --accent: #30323c; --secondary: #dce0e8;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; max-width: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100svh; position: relative; isolation: isolate; background: var(--bg); color: var(--ink); font: 15px/1.7 "Rethink Sans",system-ui,sans-serif; -webkit-font-smoothing: antialiased; }
html[dir=rtl] body { font-family: "IBM Plex Sans Arabic",system-ui,sans-serif; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: white; }
button,input,select,textarea { font: inherit; }
button,a { touch-action: manipulation; }
button { cursor: pointer; }
header { position: sticky; z-index: 10; top: 0; width: min(1160px,calc(100% - 48px)); height: 82px; margin: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--soft-line); background: rgba(3,3,5,.9); backdrop-filter: blur(18px); }
.brand { direction: ltr; display: flex; align-items: center; gap: 13px; font-family: "Rethink Sans",sans-serif; font-weight: 800; font-size: 23px; letter-spacing: -.8px; }
.brand img { width: 42px; height: 42px; }
.brand .sub,.brand .sync { color: var(--ink); }
.language { background: #171920; color: var(--ink); border: 1px solid #737785; border-radius: 9px; padding: 8px 16px; transition: border-color .2s,background .2s; }
.language:hover { border-color: #c5c7d1; background: #272a35; }
.wrap { max-width: 1208px; margin: auto; padding: 0 24px 56px; }
.hero { position: relative; display: flex; justify-content: space-between; gap: 38px; align-items: center; padding: 66px 0 60px; margin-bottom: 42px; border-bottom: 1px solid var(--soft-line); }
.hero > div { max-width: 720px; }
.eyebrow { color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1 { font-size: clamp(40px,5.1vw,70px); line-height: 1.06; letter-spacing: -.05em; margin: 18px 0 22px; font-weight: 800; text-wrap: balance; }
h1 span { color: var(--ink); }
p { color: var(--muted); margin: 10px 0; }
.hero p { max-width: 650px; font-size: 16px; line-height: 1.9; color: #c5c7d1; }
.hero-icon { width: 200px; height: 200px; flex-shrink: 0; object-fit: contain; }
.layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; align-items: start; }
.section { margin-bottom: 38px; }
.section-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.number { direction: ltr; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 11px; font-weight: 700; width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; }
h2 { font-size: 21px; margin: 0; line-height: 1.4; letter-spacing: -.025em; }
.section-note { font-size: 13px; line-height: 1.8; margin-bottom: 20px; }
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card,.box { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card { transition: transform .2s,border-color .2s,background .2s; }
.card:hover { border-color: #858997; background: var(--elevated); transform: translateY(-2px); }
.card:focus-within { border-color: #c5c7d1; }
.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-top h3 { font-size: 18px; line-height: 1.4; margin: 0; letter-spacing: -.025em; }
.card-top small { font-size: 10px; color: var(--muted); letter-spacing: .045em; }
.source-icon { width: 39px; height: 39px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: transparent; color: white; font-weight: 800; font-size: 18px; }
.source-icon img { width: 30px; height: 30px; object-fit: contain; border-radius: 5px; }
.source-icon svg { width: 27px; height: 27px; }
.card-top input { margin-inline-start: auto; accent-color: #f4f4f7; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.field { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 7px; color: #c5c7d1; }
input:not([type=checkbox]):not([type=radio]),select,textarea { width: 100%; background: #090a0f; color: var(--ink); border: 1px solid #656976; border-radius: 9px; padding: 11px 12px; outline: none; transition: border-color .2s,box-shadow .2s; }
input::placeholder,textarea::placeholder { color: #aeb2bf; opacity: .72; }
input:not([type=checkbox]):not([type=radio]):focus,select:focus,textarea:focus { border-color: #e3e5eb; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
input:disabled,select:disabled { opacity: .5; }
textarea { resize: vertical; min-height: 90px; direction: ltr; text-align: left; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 10px; }
.getkey { display: inline-block; margin-top: 7px; font-size: 12px; font-weight: 600; text-underline-offset: 4px; }
.getkey:hover { text-decoration: underline; }
.full { grid-column: 1/-1; }
.mode { display: flex; background: #090a0f; border: 1px solid var(--soft-line); border-radius: 9px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.mode button { flex: 1; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); padding: 6px 10px; font-size: 12px; }
.mode button[aria-pressed=true] { background: #303440; border-color: #858997; color: white; }
.account { display: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.toggle { display: flex; gap: 12px; align-items: start; border-top: 1px solid var(--soft-line); padding: 18px 0; cursor: pointer; }
.toggle:last-child { padding-bottom: 0; }
.toggle input { accent-color: #f4f4f7; margin-top: 6px; width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.toggle strong { display: block; font-size: 14px; font-weight: 600; }
.toggle small { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 3px; }
.install { position: sticky; top: 106px; }
.install h2 { font-size: 24px; margin: 16px 0 12px; }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 4px rgba(220,224,232,.08); margin-inline-end: 9px; }
.preview { padding: 16px; border: 1px solid var(--soft-line); background: #090a0f; border-radius: 10px; margin: 22px 0; }
.preview .eyebrow { color: var(--muted); font-size: 9px; margin-bottom: 9px; }
.preview .file { direction: ltr; text-align: left; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; margin-top: 10px; }
.preview .result { font-size: 12px; line-height: 1.8; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 24px; }
.tag,.tag.purple { font-size: 10px; border: 1px solid var(--soft-line); border-radius: 6px; padding: 4px 8px; background: rgba(255,255,255,.04); color: var(--secondary); }
.primary { background: var(--accent); color: white; border: 1px solid #656976; border-radius: 10px; display: block; text-align: center; width: 100%; padding: 13px; font-weight: 700; line-height: 1.5; transition: background .2s,border-color .2s; }
.primary:hover { background: #414550; border-color: #aeb2bf; }
.primary:disabled { opacity: .6; cursor: not-allowed; }
.secondary { width: 100%; background: transparent; color: var(--ink); border: 1px solid #858997; border-radius: 10px; padding: 10px; display: block; text-align: center; margin-top: 10px; font-size: 12px; transition: border-color .2s,background .2s; }
.secondary:hover { border-color: white; background: rgba(255,255,255,.04); }
.privacy { border-top: 1px solid var(--soft-line); margin-top: 24px; padding-top: 18px; font-size: 12px; }
.status { font-size: 13px; overflow-wrap: anywhere; white-space: pre-line; color: var(--ink); }
.status.error { color: #f87171; }
.status.success { color: #4ade80; }
.output { display: none; margin-top: 18px; }
.output input { font-size: 11px; direction: ltr; }
.output a { margin-top: 12px; }
.foot { border-top: 1px solid var(--soft-line); padding-top: 24px; display: flex; justify-content: space-between; gap: 15px; font-size: 11px; color: var(--muted); }
.foot a { text-decoration: underline; text-underline-offset: 3px; }
.saved { display: none; }
.count { color: var(--muted); font-size: 11px; margin-inline-start: auto; white-space: nowrap; }
.support { margin-top: 20px; font-size: 12px; }
[dir=rtl] h1,[dir=rtl] h2,[dir=rtl] h3 { letter-spacing: 0; }
[dir=rtl] h1 { font-size: clamp(38px,4.7vw,62px); line-height: 1.3; }
[dir=rtl] .eyebrow { letter-spacing: 0; }
[dir=rtl] input[type=url],[dir=rtl] input[type=password],[dir=rtl] input[autocomplete=username] { direction: ltr; text-align: left; }
button:focus-visible,a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@media(max-width:1000px) {
 .layout { grid-template-columns: 1fr; }
 .install { position: static; }
 .hero-icon { width: 160px; height: 160px; }
}
@media(max-width:580px) {
 header { width: calc(100% - 32px); height: 72px; }
 .brand { font-size: 21px; gap: 10px; }
 .brand img { width: 36px; height: 36px; }
 .language { padding: 7px 12px; }
 .wrap { padding: 0 16px 38px; }
 .hero { padding: 48px 0 40px; margin-bottom: 30px; }
 .hero-icon { display: none; }
 .hero p { font-size: 14px; }
 .sources,.settings-grid { grid-template-columns: 1fr; }
 .full { grid-column: auto; }
 .card,.box { padding: 22px; }
 .foot { flex-direction: column; }
 h1 { font-size: 46px; }
 [dir=rtl] h1 { font-size: 40px; }
 .count { font-size: 10px; }
 h2 { font-size: 19px; }
}
@media(prefers-reduced-motion:reduce) {
 html { scroll-behavior: auto; }
 *,*::before,*::after { transition: none !important; }
 .card:hover { transform: none; }
}

.source-check { font-size: 12px; overflow-wrap: anywhere; }
.source-check.success { color: #4ade80; }
.source-check.error,.source-check.notice { color: #f87171; }
.card[data-validation=invalid],.included-source[data-validation=invalid] { border-color: #ef4444; }
.card[data-validation=valid],.included-source[data-validation=valid] { border-color: #22c55e; }
#save { margin-top: 14px; }

/* Compact, collapsible addon and installation panels. Keep the header fixed in LTR order. */
header { direction: ltr; }
.language { direction: ltr; min-width: 50px; font-size: 23px; padding: 4px 12px; }
.number { font-size: 15px; width: 38px; height: 38px; }
.install-panel,.more-addons { border-radius: 16px; }
.install-panel { scroll-margin-top: 106px; margin-bottom: 38px; }
summary.card-top { cursor: pointer; list-style: none; margin-bottom: 0; }
summary.card-top::-webkit-details-marker { display: none; }
details[open] > summary.card-top { margin-bottom: 18px; }
.card-top h3 { font-size: 18px; line-height: 1.4; margin: 0; }
.disclosure { margin-inline-start: auto; transition: transform .2s; font-size: 21px; }
details[open] > summary .disclosure { transform: rotate(180deg); }
.included-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.included-source { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--soft-line); }
.included-name { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.included-badge { color: var(--muted); font-size: 10px; margin-inline-start: auto; white-space: nowrap; }
@media(max-width:580px) { .included-sources { grid-template-columns: 1fr; } }


/* Compact preferences: three fields and six options, with no installation sidebar. */
.preference-fields { display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: start; gap: 18px; }
.setting-field { min-width: 0; margin: 0; }
.preference-fields .field { margin: 0 0 8px; line-height: 1.5; }
.fixed-language { min-height: 46px; padding: 10px 12px; border: 1px solid var(--soft-line); border-radius: 9px; background: #090a0f; text-align: start; }
.result-language { border: 0; padding: 0; }
.result-language legend { padding: 0; }
.result-options { display: flex; gap: 8px; }
.radio-option { display: flex; flex: 1; align-items: center; gap: 8px; min-height: 46px; padding: 10px 12px; border: 1px solid #656976; border-radius: 9px; background: #090a0f; cursor: pointer; font-size: 13px; }
.radio-option:has(input:checked) { border-color: #dce0e8; background: #20222b; }
.result-options input[type=radio] { appearance: none; width: 17px; height: 17px; flex: 0 0 17px; margin: 0; padding: 0; border: 1px solid #858997; border-radius: 4px; display: grid; place-items: center; cursor: pointer; }
.result-options input[type=radio]:checked { background: #f4f4f7; border-color: #f4f4f7; }
.result-options input[type=radio]:checked::after { content: "✓"; color: #090a0f; font-size: 13px; line-height: 1; font-weight: 800; }
.result-options input[type=radio]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.toggle-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.preferences-box .toggle { margin: 0; padding: 12px; border: 1px solid var(--soft-line); border-radius: 9px; background: #090a0f; gap: 9px; }
.preferences-box .toggle strong { font-size: 13px; line-height: 1.6; }
.preferences-box .toggle small { font-size: 11px; line-height: 1.6; margin-top: 2px; }
.preferences-box .toggle input { margin-top: 3px; width: 16px; height: 16px; }
#validation-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 20px; }
@media(max-width:800px) {
 .preference-fields { grid-template-columns: 1fr 1fr; gap: 14px; }
 .result-language { grid-column: 1/-1; grid-row: 2; }
 .toggle-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
}
@media(max-width:580px) {
 .preferences-box { padding: 18px; }
 .preferences-box .toggle { padding: 10px; gap: 7px; }
 .preferences-box .toggle strong { font-size: 12px; }
 .radio-option { padding: 10px; }
 #validation-results { grid-template-columns: 1fr; }
}

/* Keep the header at the document top on phones instead of covering scrolled fields. */
@media (max-width: 580px), (hover: none) and (pointer: coarse) {
 header { position: static; }
 .install-panel { scroll-margin-top: 24px; }
}

/* AI settings and download library share the existing night surfaces. */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ai-enable { border-top: 0; padding-top: 0; }
.ai-settings { border: 0; padding: 0; margin: 0; min-width: 0; }
.ai-settings .settings-grid { align-items: start; }
.ai-provider-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 8px 0 20px; }
.ai-provider-links a,.ai-box > .getkey { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; font-size: 14px; }
.ai-billing-note { padding-top: 12px; border-top: 1px solid var(--soft-line); }
.ai-box .hint,.ai-box .toggle small { font-size: 13px; }
#ai-model { direction: ltr; text-align: left; }
.ai-box input[type=checkbox]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.skip-link { position: fixed; top: 8px; inset-inline-start: 16px; z-index: 20; transform: translateY(-180%); background: var(--elevated); border: 1px solid var(--ink); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.library-page { font-size: 16px; }
.library-page .language { min-height: 44px; font-size: 15px; }
.library-hero { padding-top: 56px; padding-bottom: 40px; margin-bottom: 32px; }
.library-hero h1 { font-size: clamp(36px,4.2vw,58px); }
.library-hero > div { max-width: 840px; }
.library-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.library-nav .secondary { width: auto; margin: 0; padding: 12px 18px; font-size: 14px; }
.library-toolbar { display: flex; gap: 24px; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.library-filter { width: min(240px,100%); flex-shrink: 0; }
.library-page .field { font-size: 14px; }
.library-page .hint,.library-page .section-note { font-size: 14px; }
.library-page .status { font-size: 15px; }
.subtitle-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 14px; }
.subtitle-item { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.subtitle-item-body { min-width: 0; }
.subtitle-item h3 { margin: 0; font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
.subtitle-release { overflow-wrap: anywhere; font-size: 14px; margin: 8px 0; }
.subtitle-meta { overflow-wrap: anywhere; color: var(--secondary); font-size: 13px; margin: 8px 0; }
.subtitle-item time { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
.subtitle-download { width: auto; min-width: 144px; margin: 0; padding: 12px 18px; flex-shrink: 0; font-size: 14px; }
.library-actions { display: flex; gap: 12px; margin-top: 20px; }
.library-actions .secondary { width: auto; margin: 0; padding: 12px 20px; font-size: 14px; }
.upload-submit { width: auto; min-width: 176px; margin-top: 20px; padding-inline: 24px; }
.upload-box input[type=file] { min-height: 48px; padding: 8px; font-size: 14px; }
.upload-box input[type=file]::file-selector-button { font: inherit; background: var(--elevated); color: var(--ink); border: 1px solid var(--line); padding: 9px 12px; border-radius: 6px; margin-inline-end: 12px; cursor: pointer; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.upload-actions .secondary { width: auto; margin: 0; padding: 12px 18px; font-size: 14px; }
.library-page .secondary:disabled { cursor: wait; opacity: .6; }
@media(max-width:700px) {
 .library-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
 .library-filter { width: 100%; }
 .subtitle-item { align-items: stretch; flex-direction: column; gap: 16px; }
 .subtitle-download { width: 100%; }
 .library-hero { padding-top: 40px; }
}
@media(max-width:580px) {
 .library-nav { flex-direction: column; }
 .library-nav .secondary,.upload-submit,.upload-actions .secondary { width: 100%; }
 .library-page h1 { font-size: 36px; }
 [dir=rtl] .library-page h1 { font-size: 34px; }
}


/* Keep long provider model names inside the responsive settings grid. */
.ai-settings .settings-grid > div { min-width: 0; }
#ai-model-picker-group input[type=search] { margin-bottom: 8px; }
#ai-model-picker { min-width: 0; text-overflow: ellipsis; }
#ai-model-retry { margin-top: 8px; }

/* Shared navigation and poster-led Arabic subtitle library. */
.top-nav { display:flex; align-items:center; gap:12px; margin-inline:20px; }
.top-nav a { min-width:94px; padding:8px 18px; text-align:center; border:1px solid var(--soft-line); border-radius:9px; font-weight:600; }
.top-nav a:hover,.top-nav a[aria-current=page] { background:var(--elevated); border-color:#858997; }
.arabic-only { display:block; padding:11px 0; }
.language-badge { font-size:12px; color:var(--muted); margin-inline-start:auto; }
.media-section { margin-block:30px 42px; }
.media-section > h3 { font-size:21px; margin-bottom:20px; }
.media-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; list-style:none; margin:20px 0; padding:0; }
.media-card { overflow:hidden; display:flex; flex-direction:column; border:1px solid var(--soft-line); border-radius:14px; background:var(--panel); }
.poster-button { display:block; width:100%; padding:0; border:0; background:#12141c; color:var(--ink); aspect-ratio:2/3; overflow:hidden; }
.media-poster { display:block; width:100%; height:100%; object-fit:cover; transition:transform .25s; }
.poster-button:hover .media-poster { transform:scale(1.03); }
.poster-placeholder { display:grid; place-items:center; height:100%; padding:24px; background:linear-gradient(140deg,#242936,#080a11); font-size:23px; font-weight:700; }
.media-card-body { padding:16px; display:flex; flex-direction:column; flex:1; min-width:0; }
.media-card-body h3 { font-size:17px; line-height:1.4; margin:0 0 8px; }
.media-logo { max-height:42px; max-width:100%; object-fit:contain; object-position:left; align-self:flex-start; margin-bottom:14px; }
.media-facts,.availability { font-size:12px; color:#c5c7d1; margin:0 0 10px; }
.media-story { font-size:13px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.media-card .subtitle-release { font-size:11px; overflow-wrap:anywhere; line-height:1.5; }
.media-card .subtitle-meta { font-size:11px; overflow-wrap:anywhere; }
.media-card time { color:var(--muted); font-size:11px; }
.media-card .subtitle-download { margin-top:auto; }
.media-details { padding:10px 0 0; border:0; background:none; color:var(--ink); text-align:start; text-decoration:underline; text-underline-offset:4px; font-size:12px; }
.library-more,.library-retry { width:fit-content; padding-inline:24px; }
.media-dialog { position:fixed; width:min(850px,calc(100% - 32px)); max-height:90svh; background:#101117; border:1px solid #656976; border-radius:18px; color:var(--ink); padding:0; }
.media-dialog::backdrop { background:rgba(0,0,0,.8); backdrop-filter:blur(6px); }
.dialog-close { position:absolute; z-index:2; top:14px; inset-inline-end:14px; border:1px solid #737785; border-radius:50%; background:#101117; color:white; width:38px; height:38px; font-size:24px; }
.detail-backdrop { width:100%; display:block; max-height:360px; object-fit:cover; }
.detail-body { padding:28px; }
.detail-logo { max-width:220px; max-height:90px; object-fit:contain; margin-bottom:18px; }
.detail-body h2 { font-size:30px; margin-bottom:14px; }
.detail-body .subtitle-release { overflow-wrap:anywhere; }
@media(max-width:1000px) { .media-grid {grid-template-columns:repeat(3,minmax(0,1fr));} }
@media(max-width:720px) {
 header {height:auto; min-height:80px; flex-wrap:wrap; padding-block:14px; gap:12px;}
 .top-nav {order:3; width:100%; margin:0; gap:8px;}
 .top-nav a {flex:1; min-width:0; padding:8px;}
 .media-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
 .media-card-body {padding:12px;}
 .media-card-body h3 {font-size:15px;}
}
@media(prefers-reduced-motion:reduce) { .media-poster {transition:none;} }


.result-formatter { margin: 24px 0; min-width: 0; }
.result-formatter input { width: 100%; }
.result-formatter output { display: block; color: var(--ink); overflow-wrap: anywhere; }
.section-icon.setting-gear svg { fill: currentColor; stroke: none; }

.result-formatter > .custom-select { margin-bottom: 16px; }
.result-format-example { margin-top: 18px; }
.result-format-preview-list { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--elevated); }
.result-format-preview-list output + output { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Keep the visibility control inside the field without covering long secrets. */
.secret-field{position:relative;min-width:0}
.secret-field>input{direction:ltr;text-align:left;padding-right:56px!important}
.secret-visibility{position:absolute;inset-inline-end:4px;top:50%;transform:translateY(-50%);width:44px;height:40px;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted)}
.secret-visibility:hover{color:var(--ink);background:var(--hover,rgba(255,255,255,.06))}
.secret-visibility:focus-visible{outline:2px solid var(--ink);outline-offset:-3px}
.secret-visibility svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
[dir=rtl] .secret-field>input{padding-left:56px!important;padding-right:12px!important}
.secret-field>input::-ms-reveal{display:none}

.preferences-box .synced-results { margin-top: 20px; min-height: 44px; }

/* Setup modes keep account connections visible and reveal optional preferences. */
.setup-hero { flex-wrap:wrap; gap:20px; }
.setup-hero h1 { letter-spacing:-.04em; }
.setup-mode { display:flex; flex-shrink:0; gap:4px; padding:4px; border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.setup-mode button { min-height:44px; padding:9px 18px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:14px; font-weight:600; }
.setup-mode button:hover { background:var(--elevated); color:var(--ink); }
.setup-mode button[aria-pressed=true] { background:#303440; color:white; }
#preferences-section[hidden] { display:none; }
@media(max-width:580px) { .setup-hero { gap:16px; } .setup-hero h1 { margin-bottom:0; } }
