/* Recap · index · page Réglages : cartes, thème, couleur principale */
  /* ---------- settings page (Profile tab) : section titles + one decorated card per setting ---------- */
  #profile .hdr-note { padding-right: 84px; }
  .set-badge { position: absolute; right: 16px; top: 50%; margin-top: -27px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%;
    border: 2px dashed var(--c); background: color-mix(in srgb, var(--c) 13%, var(--card)); box-shadow: 2px 3px 0 color-mix(in srgb, var(--c) 30%, transparent); transform: none; }
  .set-badge svg { width: 30px; height: 30px; fill: none; stroke: var(--c); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
  .set-badge::after { content: ""; position: absolute; right: -4px; top: -7px; width: 19px; height: 19px; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z'/%3E%3C/svg%3E") center / contain no-repeat; background: var(--c); animation: wrench-sway 3s ease-in-out infinite; }
  .set-badge.chain { opacity: 0; scale: .3; rotate: -50deg; transition: opacity .3s ease, scale .6s cubic-bezier(.3, 1.6, .5, 1), rotate .7s cubic-bezier(.3, 1.3, .5, 1); }
  .set-badge.chain.in { opacity: 1; scale: 1; rotate: 0deg; }
  .set-badge.chain.in svg { animation: sb-spin 22s linear 1s infinite; }
  @keyframes sb-spin { to { transform: rotate(360deg); } }

  .sset { width: 100%; padding-bottom: 70px; }
  .sg { margin: 0 0 24px; }
  .sg-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
  .sg-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50% 0 50% 0; background: var(--c); color: var(--on); box-shadow: 2px 3px 0 color-mix(in srgb, var(--c) 32%, transparent); rotate: -4deg; }
  .sg-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sg-t { position: relative; isolation: isolate; padding: 0 5px; font-family: var(--hd-brush); font-weight: 400; letter-spacing: 0; font-size: 1.75rem; line-height: 1; color: var(--text); }
  [dir="rtl"] .sg-t, :lang(ar) .sg-t { font-family: var(--hd-ar); font-weight: 700; }
  .sg-t::before { content: ""; position: absolute; z-index: -1; left: -2px; right: -2px; bottom: 1px; height: 46%; rotate: -1.4deg; border-radius: 3px 9px 4px 10px; background: color-mix(in srgb, var(--c) 36%, transparent); transform-origin: left center; }
  .sg-line { position: relative; flex: none; width: 22px; height: 22px; margin-top: 2px; }
  .sg-line::after { content: ""; position: absolute; inset: 0; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.29%204.59%20L10.49%201.91%20L13.51%201.91%20L13.71%204.59%20L16.03%205.55%20L18.07%203.80%20L20.20%205.93%20L18.45%207.97%20L19.41%2010.29%20L22.09%2010.49%20L22.09%2013.51%20L19.41%2013.71%20L18.45%2016.03%20L20.20%2018.07%20L18.07%2020.20%20L16.03%2018.45%20L13.71%2019.41%20L13.51%2022.09%20L10.49%2022.09%20L10.29%2019.41%20L7.97%2018.45%20L5.93%2020.20%20L3.80%2018.07%20L5.55%2016.03%20L4.59%2013.71%20L1.91%2013.51%20L1.91%2010.49%20L4.59%2010.29%20L5.55%207.97%20L3.80%205.93%20L5.93%203.80%20L7.97%205.55Z%20M12%208.8a3.2%203.2%200%201%200%200%206.4%203.2%203.2%200%201%200%200-6.4z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.29%204.59%20L10.49%201.91%20L13.51%201.91%20L13.71%204.59%20L16.03%205.55%20L18.07%203.80%20L20.20%205.93%20L18.45%207.97%20L19.41%2010.29%20L22.09%2010.49%20L22.09%2013.51%20L19.41%2013.71%20L18.45%2016.03%20L20.20%2018.07%20L18.07%2020.20%20L16.03%2018.45%20L13.71%2019.41%20L13.51%2022.09%20L10.49%2022.09%20L10.29%2019.41%20L7.97%2018.45%20L5.93%2020.20%20L3.80%2018.07%20L5.55%2016.03%20L4.59%2013.71%20L1.91%2013.51%20L1.91%2010.49%20L4.59%2010.29%20L5.55%207.97%20L3.80%205.93%20L5.93%203.80%20L7.97%205.55Z%20M12%208.8a3.2%203.2%200%201%200%200%206.4%203.2%203.2%200%201%200%200-6.4z'/%3E%3C/svg%3E") center / contain no-repeat; background: var(--c); animation: gear-turn 9s linear infinite; }
  .sg-h.chain:not(.in) .sg-t::before { transform: scaleX(0); }
  .sg-h.chain.in .sg-t::before { animation: marker-sweep .7s cubic-bezier(.4, .1, .2, 1) .35s both; }
  .sg-h.chain.in .sg-ic { animation: ic-pop .5s cubic-bezier(.3, 1.6, .5, 1) .1s both; }
  .sg-list { display: flex; flex-direction: column; gap: 16px; padding: 0 3px; }

  .sc { --c: var(--ink); position: relative; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 15px 14px 15px 13px; margin: 0; text-align: start; text-decoration: none; color: var(--text); font: inherit;
    background: var(--card); border: 2.5px solid var(--c); border-radius: 18px 34px 20px 30px / 30px 18px 34px 20px; box-shadow: 3px 5px 0 color-mix(in srgb, var(--c) 35%, transparent);
    rotate: -.6deg; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .sc:nth-child(even) { rotate: .7deg; border-radius: 32px 18px 30px 20px / 18px 32px 20px 30px; }
  .sc:nth-child(3n) { rotate: -.25deg; }
  div.sc { cursor: default; }
  .sc.stk { flex-wrap: wrap; row-gap: 12px; }
  @keyframes gear-turn { to { rotate: 360deg; } }
  @keyframes gear-pulse { 0%, 100% { scale: .78; opacity: .7; } 50% { scale: 1.3; opacity: 1; } }
  @keyframes wrench-sway { 0%, 100% { rotate: -14deg; } 50% { rotate: 14deg; } }
  .sc-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border: 2px dashed var(--c); border-radius: 50%; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
  .sc-ic svg { width: 24px; height: 24px; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .sc-t { position: relative; isolation: isolate; padding: 0 4px; font-family: var(--hd-hand); font-weight: 400; letter-spacing: 0; font-size: 1.2rem; line-height: 1.1; color: var(--c); }
  [dir="rtl"] .sc-t, :lang(ar) .sc-t { font-family: "Tajawal", system-ui, sans-serif; font-weight: 700; font-size: 1.05rem; }
  .sc-t::before { content: ""; position: absolute; z-index: -1; left: -3px; right: -3px; bottom: 0; height: 52%; rotate: -1.2deg; border-radius: 3px 9px 4px 10px; background: color-mix(in srgb, var(--c) 30%, transparent); transform-origin: left center; }
  .sc-tx small { padding-left: 4px; font-size: .74rem; line-height: 1.35; color: var(--muted); }
  .sc-ctl { flex: none; display: flex; align-items: center; gap: 8px; }
  .sc-ctl.full { flex: 1 1 100%; }
  .sc-ctl.full > .seg, .sc-ctl.full > .sw { flex: 1; min-width: 0; }
  .sc-ctl.upd { justify-content: space-between; }
  .sc .vtag, .sc .cur, .sc .pill { white-space: nowrap; }
  .sc .go { width: 16px; height: 16px; fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .sc .cur, .sc .vtag { padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--c) 50%, transparent); }
  .sc .pill { padding: 5px 13px; border-radius: 999px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--card)); color: var(--c); font: 800 .76rem "Tajawal", system-ui, sans-serif; box-shadow: 1px 2px 0 color-mix(in srgb, var(--c) 35%, transparent); }
  .sc .pill:active { transform: translateY(1px); box-shadow: none; }
  /* switch : two little notes OFF / ON, the active one is lifted, taped and coloured */
  .tc { flex: none; display: flex; gap: 5px; padding: 8px 0 0; border: 0; background: none; }
  .tc span { position: relative; width: 41px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 800 .62rem "Tajawal", system-ui, sans-serif; letter-spacing: .04em; color: var(--muted);
    border: 2px dashed color-mix(in srgb, var(--c) 50%, transparent); border-radius: 12px 5px 12px 5px; background: var(--card); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), background .25s ease, box-shadow .25s ease, color .25s ease; }
  .tc span + span { border-radius: 5px 12px 5px 12px; }
  .tc svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .tc span::before { content: ""; position: absolute; top: -7px; left: 50%; width: 24px; height: 10px; margin-left: -12px; rotate: -5deg; opacity: 0; scale: 1.6; box-shadow: 0 1px 2px rgba(0,0,0,.2);
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px), color-mix(in srgb, var(--c) 62%, transparent); transition: opacity .25s ease, scale .35s cubic-bezier(.3, 1.6, .5, 1); }
  .tc .o0 { color: var(--c); border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); transform: translateY(-3px) rotate(-2deg); box-shadow: 2px 3px 0 color-mix(in srgb, var(--c) 35%, transparent); }
  .tc .o0::before { opacity: 1; scale: 1; }
  .tc.on .o0 { color: var(--muted); border-style: dashed; border-color: color-mix(in srgb, var(--c) 50%, transparent); background: var(--card); transform: none; box-shadow: none; }
  .tc.on .o0::before { opacity: 0; scale: 1.6; }
  .tc.on .o1 { color: var(--c); border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); transform: translateY(-3px) rotate(2deg); box-shadow: 2px 3px 0 color-mix(in srgb, var(--c) 35%, transparent); }
  .tc.on .o1::before { opacity: 1; scale: 1; }
  /* choice list : little sticky notes, the chosen one is lifted, taped and highlighted */
  .seg { display: flex; gap: 9px; padding: 8px 2px 2px; }
  .seg button { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 9px; color: var(--text); font: 800 .76rem "Tajawal", system-ui, sans-serif;
    background: var(--card); border: 2px dashed color-mix(in srgb, var(--c) 55%, transparent); border-radius: 14px 6px 14px 6px; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), background .25s ease, box-shadow .25s ease; }
  .seg button:nth-child(even) { border-radius: 6px 14px 6px 14px; }
  .seg button svg { width: 22px; height: 22px; fill: none; stroke: color-mix(in srgb, var(--c) 70%, var(--muted)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s ease, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
  .seg button span { position: relative; isolation: isolate; padding: 0 3px; }
  .seg button span::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 48%; border-radius: 3px 8px 3px 8px; background: color-mix(in srgb, var(--c) 38%, transparent); transform: scaleX(0); transform-origin: left center; transition: transform .45s cubic-bezier(.4, .1, .2, 1) .1s; }
  .seg button::before { content: ""; position: absolute; top: -7px; left: 50%; width: 28px; height: 11px; margin-left: -14px; rotate: -5deg; opacity: 0; scale: 1.6; box-shadow: 0 1px 2px rgba(0,0,0,.2);
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px), color-mix(in srgb, var(--c) 62%, transparent); transition: opacity .25s ease, scale .35s cubic-bezier(.3, 1.6, .5, 1); }
  .seg button.on { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); transform: translateY(-3px) rotate(-1.5deg); box-shadow: 2px 4px 0 color-mix(in srgb, var(--c) 35%, transparent); }
  .seg button:nth-child(even).on { transform: translateY(-3px) rotate(1.5deg); }
  .seg button.on svg { stroke: var(--c); transform: scale(1.15); }
  .seg button.on span::before { transform: scaleX(1); }
  .seg button.on::before { opacity: 1; scale: 1; }

  /* colour swatches */
  .sw { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 7%, var(--card)); }
  .sw button { position: relative; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 2px solid var(--card); background: var(--s); box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
  .sw button.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--s), 0 3px 6px rgba(0,0,0,.3); }
  .sw button.on::after { content: ""; position: absolute; left: 11px; top: 7px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.6px 2.6px 0; rotate: 40deg; }
  .sset-end { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 0; font-family: "Caveat", cursive; font-size: 1.3rem; color: var(--muted); }
  .sset-end .drop { width: 14px; height: 14px; --c: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.29%204.59%20L10.49%201.91%20L13.51%201.91%20L13.71%204.59%20L16.03%205.55%20L18.07%203.80%20L20.20%205.93%20L18.45%207.97%20L19.41%2010.29%20L22.09%2010.49%20L22.09%2013.51%20L19.41%2013.71%20L18.45%2016.03%20L20.20%2018.07%20L18.07%2020.20%20L16.03%2018.45%20L13.71%2019.41%20L13.51%2022.09%20L10.49%2022.09%20L10.29%2019.41%20L7.97%2018.45%20L5.93%2020.20%20L3.80%2018.07%20L5.55%2016.03%20L4.59%2013.71%20L1.91%2013.51%20L1.91%2010.49%20L4.59%2010.29%20L5.55%207.97%20L3.80%205.93%20L5.93%203.80%20L7.97%205.55Z%20M12%208.8a3.2%203.2%200%201%200%200%206.4%203.2%203.2%200%201%200%200-6.4z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.29%204.59%20L10.49%201.91%20L13.51%201.91%20L13.71%204.59%20L16.03%205.55%20L18.07%203.80%20L20.20%205.93%20L18.45%207.97%20L19.41%2010.29%20L22.09%2010.49%20L22.09%2013.51%20L19.41%2013.71%20L18.45%2016.03%20L20.20%2018.07%20L18.07%2020.20%20L16.03%2018.45%20L13.71%2019.41%20L13.51%2022.09%20L10.49%2022.09%20L10.29%2019.41%20L7.97%2018.45%20L5.93%2020.20%20L3.80%2018.07%20L5.55%2016.03%20L4.59%2013.71%20L1.91%2013.51%20L1.91%2010.49%20L4.59%2010.29%20L5.55%207.97%20L3.80%205.93%20L5.93%203.80%20L7.97%205.55Z%20M12%208.8a3.2%203.2%200%201%200%200%206.4%203.2%203.2%200%201%200%200-6.4z'/%3E%3C/svg%3E") center / contain no-repeat; background: var(--c); animation: gear-turn 9s linear infinite; }
  /* arrival : same choreography as the subject cards (rise, icon pops, marker sweeps) */
  .sc.chain { transform: none; translate: 0 20px; scale: .93; transition: opacity .45s ease, translate .65s cubic-bezier(.2, 1.2, .4, 1), scale .65s cubic-bezier(.2, 1.2, .4, 1), transform .12s ease; }
  .sc.chain.in { translate: 0 0; scale: 1; }
  .sc.chain.in:active { transform: scale(.975); }
  .sc.chain:not(.in) .sc-t::before { transform: scaleX(0); }
  .sc.chain.in .sc-t::before { animation: marker-sweep .75s cubic-bezier(.4, .1, .2, 1) .5s both; }
  .sc.chain.in .sc-ic { animation: ic-pop .55s cubic-bezier(.3, 1.6, .5, 1) .18s both; }
  .sset-end.chain { transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .sc.chain, .set-badge.chain { translate: 0 0; scale: 1; rotate: 0deg; }
    .sc.chain.in .sc-t::before, .sc.chain.in .sc-ic, .sg-h.chain.in .sg-t::before, .sg-h.chain.in .sg-ic, .set-badge.chain.in svg, .set-badge::after, .sg-line::after { animation: none; }
  }

  /* réglage sans effet pour le moment (ex. vitesse quand le stylo est coupé) */
  .sc.dis { opacity: .45; filter: saturate(.5); pointer-events: none; transition: opacity .25s ease; }
