/* SETTLE: plays once on hover, then rests where it started. */
@keyframes icmTick        { from { stroke-dashoffset: 26; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawBox     { from { stroke-dashoffset: 58; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawFrame   { from { stroke-dashoffset: 68.5; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawLine    { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }
@keyframes icmHandlePop   { 0%, 100% { transform: scale(1); }  45% { transform: scale(1.28); } }
@keyframes icmInkLine     { from { stroke-dashoffset: 8; }  to { stroke-dashoffset: 0; } }
@keyframes icmDrawSlash   { from { stroke-dashoffset: 17; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawRidge   { from { stroke-dashoffset: 23; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawBubble  { from { stroke-dashoffset: 67; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawCurve   { from { stroke-dashoffset: 17.5; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawBar     { from { stroke-dashoffset: 7; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawPlus    { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }
@keyframes icmShrink      { 0%, 100% { transform: scale(1); }  45% { transform: scale(0.68); } }
@keyframes icmDotPulse    { 0%, 100% { transform: scale(1); }  45% { transform: scale(1.5); } }
@keyframes icmDrawText    { 0% { stroke-dashoffset: 8; } 100% { stroke-dashoffset: 0; } }
@keyframes icmRowIn       { 0% { transform: translateX(-4px) scale(0.6); } 100% { transform: none; } }
@keyframes icmMicPulse    { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
@keyframes icmWaveOutL    { 0% { transform: translateX(2px) scale(0.2); }  100% { transform: none; } }
@keyframes icmWaveOutR    { 0% { transform: translateX(-2px) scale(0.2); } 100% { transform: none; } }
@keyframes icmLedBlink    { 0%, 100% { transform: scale(1); }  40% { transform: scale(2.1); } }
@keyframes icmBulbGlow    { 0%, 100% { transform: scale(1); }  45% { transform: scale(1.12); } }
@keyframes icmStamp       { 0% { transform: scale(0.55); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes icmPencilStroke{ 0%, 100% { transform: none; }      45% { transform: translate(-4.17%, 4.17%) rotate(-8deg); } }
@keyframes icmPressDown   { 0%, 100% { transform: none; }      45% { transform: translateY(6.67%); } }
@keyframes icmRiseIn      { from { transform: translateY(25%); }              to { transform: none; } }
@keyframes icmDotBounce   { 0%, 100% { transform: none; }      45% { transform: translateY(-2px); } }
@keyframes icmBob         { 0%, 100% { transform: none; }      45% { transform: translateY(-1.6px); } }
@keyframes icmGlance      { 0%, 100% { transform: none; }      30% { transform: translateX(-1.4px); } 65% { transform: translateX(1.4px); } }
@keyframes icmTremor      { 0%, 100% { transform: none; }      25% { transform: translateX(-1px); } 55% { transform: translateX(0.9px); } 80% { transform: translateX(-0.45px); } }
@keyframes icmShake       { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 55% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
@keyframes icmWave        { 0%, 100% { transform: skewX(0); }  30% { transform: skewX(7deg); } 65% { transform: skewX(-5deg); } }
@keyframes icmSunDrop     { 0% { transform: translateY(-1.6px); } 70% { transform: translateY(0.3px); } 100% { transform: none; } }
@keyframes icmTurnCw      { from { transform: rotate(0); }      to { transform: rotate(360deg); } }
@keyframes icmTurnCcw     { from { transform: rotate(0); }      to { transform: rotate(-360deg); } }
@keyframes icmRock        { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-11deg); } 55% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes icmDrawShaft   { from { stroke-dashoffset: -31; } to { stroke-dashoffset: 0; } }
@keyframes icmDrawHead    { from { stroke-dashoffset: 15; }  to { stroke-dashoffset: 0; } }
@keyframes icmRub         { 0%, 100% { transform: none; }    45% { transform: translateX(4px); } }
@keyframes icmRubOut      { 0%, 100% { stroke-dashoffset: 0; } 45% { stroke-dashoffset: 4; } }
@keyframes icmDrawLine16  { from { stroke-dashoffset: 15; }  to { stroke-dashoffset: 0; } }
@keyframes icmDrawBox16   { from { stroke-dashoffset: 39; }  to { stroke-dashoffset: 0; } }
@keyframes icmNodePulse   { 0%, 100% { transform: scale(1); }  45% { transform: scale(1.45); } }
@keyframes icmLiftOff     { 0%, 100% { transform: none; }      45% { transform: translateY(-2.6px); } }
@keyframes icmLayerBot    { 0% { transform: translateY(4.5px); } 65% { transform: translateY(-0.5px); } 100% { transform: none; } }
@keyframes icmLayerMid    { 0% { transform: translateY(3.5px); } 65% { transform: translateY(-0.4px); } 100% { transform: none; } }
@keyframes icmLayerTop    { 0% { transform: translateY(-3px); }  65% { transform: translateY(0.4px); }  100% { transform: none; } }

/* Plus draws stroke by stroke (14 units each; plus-circle's inner cross is 8); minus still shrinks. */
.ic-plus .ic-stroke   { --ic-ms: 0.2s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 14; --ic-play: icmDrawPlus; }
.ic-plus .ic-stroke:nth-of-type(2) { --ic-delay: 0.2s; }
.ic-plus-circle .ic-stroke { --ic-ms: 0.2s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 8; --ic-play: icmInkLine; }
.ic-plus-circle .ic-stroke:nth-of-type(2) { --ic-delay: 0.2s; }
.ic-minus             { --ic-ms: 0.34s; --ic-play: icmShrink; }
/* A NEGATIVE dash offset draws the shaft from its far end towards the head. */
.ic-undo .ic-shaft, .ic-redo .ic-shaft {
    --ic-ms: 0.42s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1);
    stroke-dasharray: 31; --ic-play: icmDrawShaft;
}
.ic-undo .ic-head, .ic-redo .ic-head {
    --ic-ms: 0.2s; --ic-delay: 0.38s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1);
    stroke-dasharray: 15; --ic-play: icmDrawHead;
}
/* Whole revolutions: each rests exactly where it started. */
.ic-rotate-ccw        { --ic-ms: 0.413s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); --ic-play: icmTurnCcw; }
.ic-rotate-cw         { --ic-ms: 0.413s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); --ic-play: icmTurnCw; }
.ic-refresh-cw        { --ic-ms: 0.62s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); --ic-play: icmTurnCw; }
.ic-check .ic-tick    { --ic-ms: 0.64s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 26; --ic-play: icmTick; }
/* 12√2 ≈ 16.97 units per stroke; 1.5× the base 0.18s draw-on. */
.ic-x .ic-stroke      { --ic-ms: 0.27s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 17; --ic-play: icmDrawSlash; }
.ic-x .ic-stroke:nth-of-type(2) { --ic-delay: 0.27s; }
.ic-rect .ic-box      { --ic-ms: 0.34s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 58; --ic-play: icmDrawBox; }
.ic-line .ic-stroke   { --ic-ms: 0.34s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 22; --ic-play: icmDrawLine; }
.ic-compare .ic-box    { --ic-ms: 0.34s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 68.5; --ic-play: icmDrawFrame; }
.ic-compare .ic-stroke { --ic-ms: 0.2s; --ic-delay: 0.34s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 22; --ic-play: icmDrawLine; }
.ic-line .ic-handle, .ic-rect .ic-handle {
    --ic-ms: 0.3s; --ic-delay: 0.09s; --ic-play: icmHandlePop;
    transform-box: fill-box; transform-origin: center;
}
.ic-line .ic-handle:nth-of-type(2), .ic-rect .ic-handle:nth-of-type(2) { --ic-delay: 0.17s; }
.ic-file-text .ic-textline { --ic-ms: 0.3s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 8; --ic-play: icmInkLine; }
.ic-file-text .ic-textline:nth-of-type(2) { --ic-delay: 0.09s; }
.ic-message .ic-outline { --ic-ms: 0.36s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 67; --ic-play: icmDrawBubble; }
.ic-function .ic-curve { --ic-ms: 0.28s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 17.5; --ic-play: icmDrawCurve; }
.ic-function .ic-bar   { --ic-ms: 0.14s; --ic-delay: 0.2s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 7; --ic-play: icmDrawBar; }
.ic-pencil            { --ic-ms: 0.3s; --ic-play: icmPencilStroke; }
.ic-rect-filled       { --ic-ms: 0.32s; --ic-play: icmStamp; }
/* A positive dash offset eats the baseline from the x=7 end the pad starts on. */
.ic-eraser .ic-body     { --ic-ms: 0.52s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmRub; }
.ic-eraser .ic-baseline { --ic-ms: 0.52s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1);
                          stroke-dasharray: 15; --ic-play: icmRubOut; }
.ic-pin                { --ic-ms: 0.3s; --ic-play: icmPressDown; }
.ic-save                { --ic-ms: 0.42s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); --ic-play: icmRiseIn; }
.ic-alert             { --ic-ms: 0.3s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmShake; }
/* TRANSLATION, not rotation: turning the mark swings it out of its ring. */
.ic-help .ic-mark     { --ic-ms: 0.3s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmTremor; }
.ic-info .ic-mark,
.ic-calendar .ic-rings { --ic-ms: 0.3s; --ic-play: icmBob; }
.ic-eye .ic-pupil     { --ic-ms: 0.42s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmGlance; }
/* The sun's top rests 2 units under the frame's inner edge: 1.6 is the whole drop the frame allows. */
.ic-image .ic-ridge   { --ic-ms: 0.34s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 23; --ic-play: icmDrawRidge; }
.ic-image .ic-orb     { --ic-ms: 0.3s; --ic-delay: 0.09s; --ic-play: icmSunDrop; }
.ic-flag .ic-cloth    { --ic-ms: 0.42s; transform-origin: 4px 3px; --ic-play: icmWave; }
.ic-lightbulb .ic-bulb { --ic-ms: 0.34s; transform-origin: 12px 17px; --ic-play: icmBulbGlow; }
.ic-sparkle .ic-dot, .ic-dots .ic-dot { --ic-ms: 0.3s; --ic-play: icmDotBounce; }
.ic-sparkle .ic-dot:nth-of-type(2), .ic-dots .ic-dot:nth-of-type(2) { --ic-delay: 0.07s; }
.ic-sparkle .ic-dot:nth-of-type(3), .ic-dots .ic-dot:nth-of-type(3) { --ic-delay: 0.14s; }
.ic-palette .ic-dot   { --ic-ms: 0.32s; --ic-play: icmDotPulse; transform-box: fill-box; transform-origin: center; }
.ic-palette .ic-dot:nth-of-type(2) { --ic-delay: 0.055s; }
.ic-palette .ic-dot:nth-of-type(3) { --ic-delay: 0.11s; }
/* Markup order is the stagger order (paths 1–3 left, 4–6 right; the body is a <g>). */
/* Markup order is the stagger order. */
.ic-description .ic-text { --ic-ms: 0.22s; --ic-ease: cubic-bezier(0.33, 1, 0.68, 1); stroke-dasharray: 8; --ic-play: icmDrawText; }
.ic-description .ic-text:nth-of-type(2) { --ic-delay: 0.09s; }
.ic-description .ic-text:nth-of-type(3) { --ic-delay: 0.18s; }
.ic-keywords .ic-row  { --ic-ms: 0.4s; --ic-play: icmRowIn; transform-box: fill-box; transform-origin: center; }
.ic-keywords .ic-row:nth-of-type(2) { --ic-delay: 0.15s; }
.ic-keywords .ic-row:nth-of-type(3) { --ic-delay: 0.3s; }
.ic-mic .ic-body      { --ic-ms: 0.3s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmMicPulse; }
.ic-mic .ic-wave-l    { --ic-ms: 0.2s; --ic-play: icmWaveOutL; transform-box: fill-box; transform-origin: center; }
.ic-mic .ic-wave-r    { --ic-ms: 0.2s; --ic-play: icmWaveOutR; transform-box: fill-box; transform-origin: center; }
.ic-mic .ic-wave-l:nth-of-type(2), .ic-mic .ic-wave-r:nth-of-type(5) { --ic-delay: 0.06s; }
.ic-mic .ic-wave-l:nth-of-type(3), .ic-mic .ic-wave-r:nth-of-type(6) { --ic-delay: 0.12s; }
.ic-palette .ic-dot:nth-of-type(4) { --ic-delay: 0.165s; }
/* All THREE nodes swell in turn (two read as one broken); markup order is the sequence the desktop port
   staggers on (support/icon/iconMotion.hpp). */
.ic-share .ic-node { --ic-ms: 0.38s; --ic-play: icmNodePulse;
                     transform-box: fill-box; transform-origin: center; }
.ic-share .ic-node:nth-of-type(2) { --ic-delay: 0.12s; }
.ic-share .ic-node:nth-of-type(3) { --ic-delay: 0.24s; }
/* 1.2 units was half a pixel at toolbar size: no motion at all. */
.ic-monitor .ic-screen { --ic-ms: 0.38s; --ic-play: icmLiftOff; }
.ic-server .ic-led    { --ic-ms: 0.36s; --ic-play: icmLedBlink; }
.ic-server .ic-led:nth-of-type(1) { transform-origin: 6px 6px; }
.ic-server .ic-led:nth-of-type(2) { transform-origin: 6px 18px; --ic-delay: 0.11s; }
/* The moon rocks; a turn is plain on a rayed disc and nonsense on a crescent. */
.ic-moon              { --ic-ms: 0.52s; --ic-ease: cubic-bezier(0.4, 0, 0.2, 1); --ic-play: icmRock; }
.ic-layers .ic-layer-bot { --ic-ms: 0.38s; --ic-play: icmLayerBot; }
.ic-layers .ic-layer-mid { --ic-ms: 0.38s; --ic-delay: 0.07s; --ic-play: icmLayerMid; }
.ic-layers .ic-layer-top { --ic-ms: 0.38s; --ic-delay: 0.14s; --ic-play: icmLayerTop; }

/* An animating glyph owns its transform: a transition on it would land the icon crooked. */
.is-loading .ic, .is-loading .ic *, .swapping > svg, .swapping > svg * { transition: none; }
#theme-toggle { transition: background 0.2s, border-color 0.2s, transform 0.3s ease; }
#theme-toggle:active { transform: scale(0.95); }
@media (prefers-reduced-motion: reduce) {
    /* Only the hover move: the fold chevrons' rotate(180deg) is state and must survive. */
    .ic, .draw-mode-icon, .ic *, .draw-mode-icon * {
        --ic-on: 0 !important;
        animation-name: none !important;
        transition: none !important;
    }
}

