:root {
  --bg: #f4f7fd;
  --panel: rgba(255,255,255,.82);
  --text: #172238;
  --muted: #748097;
  --line: #e1e7f0;
  --primary: #315efb;
  --primary-soft: #edf2ff;
  --cyan: #35c8ea;
  --green: #12a875;
  --green-soft: #e9f8f2;
  --red: #ef5350;
  --red-soft: #fff0ef;
  --yellow: #e5a229;
  --yellow-soft: #fff6df;
  --shadow: 0 14px 45px rgba(52, 76, 125, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: radial-gradient(circle at 8% 4%, #e2eaff 0, transparent 33%), radial-gradient(circle at 96% 44%, #dff9fb 0, transparent 27%), var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.background-orb { position: fixed; border-radius: 50%; filter: blur(10px); pointer-events: none; z-index: -1; opacity: .45; }
.orb-one { width: 280px; height: 280px; background: #b7c7ff; left: -150px; top: 42%; }
.orb-two { width: 240px; height: 240px; background: #b7f0ef; right: -130px; top: 16%; }
.page-shell { width: min(1390px, calc(100% - 40px)); margin: 24px auto 32px; }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.92); box-shadow: var(--shadow); backdrop-filter: blur(18px); border-radius: 24px; }
.top-nav { position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 12px 10px 18px; margin-bottom: 14px; background: rgba(255,255,255,.91); border: 1px solid rgba(255,255,255,.96); box-shadow: var(--shadow); border-radius: 20px; backdrop-filter: blur(18px); }
.brand-link { text-decoration: none; font-weight: 950; letter-spacing: -.04em; padding: 10px 8px; font-size: 18px; white-space: nowrap; }
.page-tabs { display: grid; grid-template-columns: repeat(3, minmax(155px, 1fr)); gap: 6px; padding: 5px; border: 1px solid #e2e8f2; border-radius: 16px; background: #f2f5fa; }
.page-tab { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid transparent; border-radius: 12px; color: #6d788b; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease; }
.page-tab:hover { color: var(--primary); background: rgba(255,255,255,.72); }
.page-tab.active { color: white; background: linear-gradient(135deg, var(--primary), #587cff); border-color: rgba(49,94,251,.24); box-shadow: 0 8px 20px rgba(49,94,251,.23); transform: translateY(-1px); }
.page-tab > span:last-child { display: grid; gap: 2px; }
.page-tab b { font-size: 13px; line-height: 1.2; }
.page-tab small { color: #929bad; font-size: 10px; line-height: 1.2; white-space: nowrap; }
.page-tab.active small { color: rgba(255,255,255,.78); }
.tab-mark { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #aab4c5; box-shadow: 0 0 0 5px rgba(145,157,177,.12); }
.live-mark { background: #18b981; box-shadow: 0 0 0 5px rgba(24,185,129,.12); }
.history-mark { background: #7c65df; box-shadow: 0 0 0 5px rgba(124,101,223,.12); }
.settings-mark { background: #e5a229; box-shadow: 0 0 0 5px rgba(229,162,41,.13); }
.page-tab.active .tab-mark { background: white; box-shadow: 0 0 0 5px rgba(255,255,255,.16); }
.redirect-page { width: min(430px, calc(100% - 30px)); min-height: 180px; margin: 18vh auto; padding: 30px; display: grid; place-items: center; gap: 18px; text-align: center; }
.hero { min-height: 170px; padding: 34px 36px; display: flex; align-items: center; justify-content: space-between; gap: 26px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 230px; height: 230px; right: -74px; bottom: -105px; border-radius: 50%; background: linear-gradient(145deg, #cddcff, #def7ff); opacity: .75; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow, .section-kicker { color: var(--primary); font-weight: 900; font-size: 11px; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 25px; height: 2px; background: var(--primary); border-radius: 2px; }
h1 { margin: 12px 0 5px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.05em; line-height: 1.1; }
.hero p { color: var(--muted); margin: 0; max-width: 780px; line-height: 1.8; }
.hero-badge { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #e2e8f2; border-radius: 999px; color: #667389; background: rgba(255,255,255,.72); font-size: 12px; white-space: nowrap; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(18,168,117,.11); }
.control-panel, .content-panel, .position-panel, .market-panel, .results-panel, .formula-panel { margin-top: 16px; padding: 24px; }
.control-grid { display: grid; grid-template-columns: minmax(360px, 2fr) repeat(3, minmax(150px, 1fr)); gap: 14px; align-items: start; }
.control-grid.two { grid-template-columns: minmax(360px, 2fr) minmax(180px, .7fr); }
.control-grid.history { grid-template-columns: minmax(360px, 2fr) repeat(2, minmax(160px, .75fr)); }
.control-grid.compact-control { grid-template-columns: minmax(180px, 320px); margin-top: 18px; }
.control-grid.analysis-controls { grid-template-columns: repeat(2, minmax(180px, 300px)); margin-top: 18px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; font-weight: 800; color: #66758a; }
.field small { color: #8f99aa; }
textarea, input, select { width: 100%; border: 1px solid #dce3ee; background: rgba(255,255,255,.82); color: var(--text); border-radius: 12px; padding: 10px 13px; outline: none; transition: .18s ease; }
textarea { resize: vertical; min-height: 94px; line-height: 1.55; }
input, select { min-height: 43px; }
textarea:focus, input:focus, select:focus { border-color: #9bb0ff; box-shadow: 0 0 0 4px rgba(49,94,251,.08); }
.input-suffix { position: relative; }
.input-suffix b { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #78859a; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; padding: 8px 15px; border: 1px solid transparent; font-weight: 800; text-decoration: none; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--primary), #5278ff); box-shadow: 0 8px 20px rgba(49,94,251,.23); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-light, .btn-ghost { color: #536079; background: #f3f6fb; border-color: #e1e7f0; }
.btn-ghost { color: var(--primary); background: var(--primary-soft); }
.full-btn { width: 100%; margin-top: 12px; }
.sync-line { margin-top: 13px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.sync-line small { color: #8792a4; }
.sync-status { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.sync-status span { width: 8px; height: 8px; border-radius: 50%; }
.sync-status.pending { color: #9b6a17; background: var(--yellow-soft); }.sync-status.pending span { background: var(--yellow); }
.sync-status.saving { color: var(--primary); background: #edf2ff; }.sync-status.saving span { background: var(--primary); animation: syncPulse 1s ease-in-out infinite; }
.sync-status.synced { color: var(--green); background: var(--green-soft); }.sync-status.synced span { background: var(--green); }
.sync-status.local { color: #69768b; background: #eef1f5; }.sync-status.local span { background: #96a0b0; }
.sync-status.error { color: var(--red); background: var(--red-soft); }.sync-status.error span { background: var(--red); }
@keyframes syncPulse { 50% { opacity: .35; transform: scale(.75); } }
.global-message { min-height: 0; margin-top: 10px; padding: 0; border-radius: 10px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.global-message:not(:empty) { padding: 9px 11px; }
.global-message.error { color: var(--red); background: var(--red-soft); border: 1px solid #ffd6d3; }
.global-message.success { color: var(--green); background: var(--green-soft); border: 1px solid #ccefe1; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-title h2, .market-head h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.035em; }
.section-title p { color: var(--muted); margin: 0; font-size: 12px; }
.page-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.page-choice { padding: 26px; text-decoration: none; position: relative; overflow: hidden; transition: .2s ease; }
.page-choice:hover { transform: translateY(-3px); box-shadow: 0 20px 55px rgba(52,76,125,.14); }
.page-choice .choice-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; font-size: 22px; background: var(--primary-soft); color: var(--primary); }
.page-choice.history-choice .choice-icon { background: var(--green-soft); color: var(--green); }
.page-choice h2 { margin: 18px 0 8px; }
.page-choice p { color: var(--muted); line-height: 1.7; margin: 0; }
.choice-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.choice-meta span { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 5px 9px; color: #6c7890; background: #f1f4f8; }
.saved-overview { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.big-number { font-size: 54px; font-weight: 950; letter-spacing: -.07em; color: var(--primary); }
.code-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.code-chip { display: inline-flex; flex-direction: column; gap: 1px; background: #f1f5ff; color: #405170; border: 1px solid #e0e8ff; border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 12px; }
.code-chip small { font-weight: 500; color: #8792a4; }

.saved-list-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.saved-list-row h2 { margin: 5px 0 5px; font-size: 22px; letter-spacing: -.035em; }
.saved-list-row p { margin: 0; line-height: 1.7; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.realtime-section-title { align-items: flex-end; margin-bottom: 8px; }
.realtime-toolbar { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.refresh-control { min-width: 145px; display: grid; gap: 5px; }
.refresh-control > span { color: #788497; font-size: 11px; font-weight: 800; }
.refresh-control select { min-height: 40px; padding: 7px 34px 7px 11px; border-radius: 11px; background-color: rgba(255,255,255,.9); }
.realtime-toolbar .btn { min-height: 40px; }
.results-message:not(:empty) { margin: 4px 0 12px; }
.table-note { margin: 0 0 11px; color: var(--muted); font-size: 12px; text-align: right; }
.settings-help { margin-bottom: 14px; padding: 12px 14px; color: #68758a; background: #f5f7fb; border: 1px solid #e7ebf2; border-radius: 12px; font-size: 12px; line-height: 1.7; }

.add-holding-grid { display: grid; grid-template-columns: minmax(180px,.8fr) repeat(2,minmax(220px,1fr)); gap: 14px; align-items: start; }
.calculation-note { margin-top: 14px; padding: 11px 13px; border-radius: 12px; color: #657389; background: #f5f8ff; border: 1px solid #e2e9fb; font-size: 12px; line-height: 1.7; }
.calculated-share { display: grid; gap: 3px; min-width: 120px; }
.calculated-share b { font-size: 14px; }
.calculated-share small { color: var(--muted); font-size: 10px; }
.editable-share { display: grid; gap: 4px; min-width: 150px; }
.editable-share small { color: var(--muted); font-size: 10px; line-height: 1.45; }

.mobile-calculated-field { display: grid; gap: 8px; padding: 11px 12px; border-radius: 12px; background: #f5f7fb; }
.mobile-calculated-field > span { font-size: 12px; font-weight: 800; color: #66758a; }
.settings-table { min-width: 900px; }
.settings-table input { min-width: 150px; min-height: 38px; }
.btn-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.danger-outline { color: var(--red); border-color: #ffd2d0; background: #fff7f7; }
.danger-outline:hover { background: var(--red-soft); }
.settings-mobile-fields { display: grid; gap: 11px; margin-top: 15px; }
.empty-mobile-card { padding: 20px; border: 1px dashed #d8dfeb; border-radius: 15px; color: #8792a5; text-align: center; background: rgba(255,255,255,.55); }
.empty-mobile-card a { color: var(--primary); font-weight: 800; }

.market-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.market-panel > p { margin: 15px 0 0; color: var(--muted); }
.market-status { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.market-status span { width: 9px; height: 9px; border-radius: 50%; }
.market-status.neutral { background: #f0f3f8; color: #6f7b8d; }.market-status.neutral span { background: #98a3b5; }
.market-status.cool { background: var(--green-soft); color: var(--green); }.market-status.cool span { background: var(--green); }
.market-status.hot { background: var(--red-soft); color: var(--red); }.market-status.hot span { background: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat-card { padding: 18px 19px; min-height: 120px; display: flex; flex-direction: column; }
.stat-card > span { font-size: 12px; color: #7c8798; font-weight: 730; }
.stat-card strong { margin-top: 7px; font-size: 29px; line-height: 1.15; letter-spacing: -.035em; }
.stat-card small { margin-top: auto; color: #9aa3b2; }
.stat-card.positive strong { color: var(--red); }.stat-card.negative strong { color: var(--green); }.stat-card.warning strong { color: var(--yellow); }.stat-card.danger strong { color: var(--red); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table { min-width: 820px; }
.analysis-table { min-width: 1380px; }
th { padding: 13px 12px; background: #f6f8fc; color: #68758a; font-size: 12px; text-align: left; font-weight: 800; border-bottom: 1px solid var(--line); }
td { padding: 15px 12px; border-bottom: 1px solid #edf0f5; vertical-align: top; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(246,249,255,.72); }
.table-empty { text-align: center; color: #939dae; padding: 42px !important; }
.fund-name { font-weight: 850; font-size: 14px; max-width: 180px; }
.fund-code, .muted { color: var(--muted); font-size: 12px; }
.change { font-size: 18px; font-weight: 900; white-space: nowrap; }.change.up, .text-red { color: var(--red); }.change.down, .text-green { color: var(--green); }.change.flat { color: #758197; }
.signal-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 6px 9px; border-radius: 999px; font-weight: 850; font-size: 12px; }
.signal-pill.buy { color: var(--green); background: var(--green-soft); }.signal-pill.hold { color: #ac7219; background: var(--yellow-soft); }.signal-pill.sell { color: var(--red); background: var(--red-soft); }
.source-tag { display: inline-block; margin-top: 5px; font-size: 10px; padding: 2px 6px; border-radius: 6px; color: #788497; background: #eff2f7; }
.text-link { color: var(--primary); font-weight: 800; text-decoration: none; }
.action-title { font-weight: 850; max-width: 190px; }.action-detail { color: var(--muted); margin-top: 5px; max-width: 230px; }
.score-stack { min-width: 125px; }.score-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }.score-line b { font-size: 13px; }
.score-bar { height: 6px; background: #edf0f5; border-radius: 99px; overflow: hidden; margin-bottom: 8px; }.score-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.metric-list { display: grid; gap: 3px; white-space: nowrap; }.metric-list span { color: var(--muted); }.metric-list b { color: var(--text); }
.reason-list { margin: 0; padding-left: 16px; max-width: 230px; color: #667388; }.reason-list li { margin-bottom: 3px; }
.sparkline { width: 150px; height: 52px; overflow: visible; }.sparkline .grid { stroke: #e8edf4; stroke-width: 1; }.sparkline polyline { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.error-row td { background: #fff8f8; }.error-text { color: var(--red); }
.position-editor { overflow-x: auto; }
.empty-state-mini { color: #8792a5; padding: 16px 4px; }
.position-table { min-width: 900px; }
.position-table input { min-width: 120px; min-height: 38px; }
.mobile-cards { display: none; }
.mobile-fund-card { border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.68); padding: 16px; }
.mobile-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mobile-card-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 14px; }
.mobile-metric { padding: 10px; border-radius: 12px; background: #f5f7fb; }.mobile-metric span { display: block; color: var(--muted); font-size: 11px; }.mobile-metric b { font-size: 14px; }
.mobile-action { margin-top: 12px; padding: 12px; background: #f5f7fb; border-radius: 12px; }.mobile-action b { display: block; }.mobile-action p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.chart-mobile { margin-top: 10px; }
.formula-panel details summary { cursor: pointer; font-weight: 850; }
.formula-content { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.formula-content > div { padding: 14px; border-radius: 14px; background: #f6f8fc; }
.formula-content h3 { margin: 0 0 7px; font-size: 14px; }
.formula-content code { color: #42516a; white-space: normal; }
.formula-content p { grid-column: 1 / -1; color: var(--muted); margin: 0; }
footer { padding: 22px 10px 0; text-align: center; color: #8c96a7; font-size: 12px; }
.loading-overlay { position: fixed; inset: 0; z-index: 99; background: rgba(20,30,48,.28); backdrop-filter: blur(5px); display: grid; place-items: center; }
.loading-overlay[hidden] { display: none; }
.loader-card { min-width: 250px; padding: 25px; border-radius: 20px; background: white; box-shadow: 0 25px 70px rgba(21,33,55,.22); display: grid; justify-items: center; gap: 8px; }
.loader-card span { color: var(--muted); font-size: 13px; }
.spinner { width: 34px; height: 34px; border: 3px solid #e8ecf5; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1000px) {
  .control-grid, .control-grid.two, .control-grid.history { grid-template-columns: repeat(2, 1fr); }
  .add-holding-grid { grid-template-columns: repeat(2, 1fr); }
  .add-holding-grid .field:first-child { grid-column: 1 / -1; }
  .field-wide { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-choices { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .mobile-cards { display: grid; gap: 12px; }
}
@media (max-width: 680px) {
  .page-shell { width: calc(100% - 14px); margin-top: 8px; }
  .top-nav { top: 5px; flex-direction: column; align-items: stretch; gap: 5px; padding: 8px; }
  .brand-link { text-align: center; padding: 6px; }
  .page-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .page-tab { min-height: 50px; justify-content: center; padding: 8px 7px; gap: 7px; }
  .page-tab small { display: none; }
  .hero, .control-panel, .content-panel, .position-panel, .market-panel, .results-panel, .formula-panel { border-radius: 18px; padding: 19px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-badge { white-space: normal; }
  .control-grid, .control-grid.two, .control-grid.history { grid-template-columns: 1fr; }
  .add-holding-grid { grid-template-columns: 1fr; }
  .add-holding-grid .field:first-child { grid-column: auto; }
  .field-wide { grid-column: auto; }
  .button-row { display: grid; grid-template-columns: repeat(2, 1fr); }.btn-primary { grid-column: span 2; order: -1; }
  .sync-line { align-items: flex-start; flex-direction: column; }
  .section-title, .market-head, .saved-list-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .inline-actions { width: 100%; justify-content: stretch; }
  .inline-actions .btn { flex: 1; }
  .realtime-toolbar { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .refresh-control { min-width: 0; }
  .realtime-toolbar .btn-primary { grid-column: auto; order: 0; white-space: nowrap; }
  .table-note { text-align: left; }
  .saved-overview { grid-template-columns: 1fr; gap: 8px; }
  .big-number { font-size: 42px; }
  h1 { font-size: 31px; }
}

/* v2.5.1-modal2: 设置页连续新增基金弹框 */
.settings-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0 14px; padding: 11px 13px; border: 1px solid #e5eaf3; border-radius: 13px; background: rgba(248,250,254,.86); }
.settings-tools-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.compact-sync-line { margin: 0; justify-content: flex-end; min-width: 0; }
.compact-sync-line small { max-width: 580px; }
body.modal-open { overflow: hidden; }
.modal-shell { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; }
.modal-shell[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18,28,48,.38); backdrop-filter: blur(7px); }
.modal-card { position: relative; z-index: 1; width: min(560px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: 24px; border: 1px solid rgba(255,255,255,.8); border-radius: 22px; background: rgba(255,255,255,.98); box-shadow: 0 30px 90px rgba(20,34,62,.28); animation: modalEnter .18s ease-out; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-header h2 { margin: 4px 0 0; font-size: 24px; }
.modal-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid #e1e6ef; border-radius: 12px; color: #657188; background: #f7f9fc; font-size: 25px; line-height: 1; cursor: pointer; transition: .18s ease; }
.modal-close:hover { color: var(--red); background: var(--red-soft); border-color: #ffd4d2; }
.modal-form { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.modal-actions .btn-primary { order: 0; grid-column: auto; }
@keyframes modalEnter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .settings-tools { align-items: stretch; flex-direction: column; }
  .settings-tools-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .compact-sync-line { align-items: flex-start; justify-content: flex-start; }
  .modal-card { padding: 20px; border-radius: 19px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .modal-actions .btn { width: 100%; }
  .modal-actions .btn-primary { order: 0; grid-column: 1 / -1; }
}
.loading-overlay { z-index: 140; }
.modal-card .global-message { margin-top: 14px; }
