/*
    Settings > Import data, the hero (imh-*): the pitch on the left and ImportHeroStory on the right, one product window
    that walks a YNAB file through the page's own steps. Deliberately quiet: neutral surfaces from the My Accounts tokens
    (--mya-*), one accent (the primary violet, --mya-violet, which follows the accent shift), green only for a finished
    check, amber only for a name that still needs a pick. No glows, no gradient text, no tinted tiles. Dark follows
    data-bs-theme="dark" on <html>.

    Timing is one small system: every timed part carries its start in seconds as --at, and .imh-a reveals it at that
    moment. Meters take --for (seconds) and --w (0-1); counters take --to. The pointer (.imh-cursor) glides in for 0.8s,
    clicks at --at + 0.9s and fades. Each scene is re-keyed by the component, so it replays from zero. Nothing animated
    carries a drop shadow; prefers-reduced-motion shows each scene's finished frame (and import-center.css already
    collapses every animation under .imc-page).
*/

.imh {
    --imh-accent: var(--mya-violet);
    --imh-accent-line: color-mix(in srgb, var(--mya-violet) 40%, transparent);
    --imh-accent-ring: color-mix(in srgb, var(--mya-violet) 16%, transparent);
    --imh-ink: var(--mya-text);
    --imh-muted: var(--mya-muted);
    --imh-faint: var(--mya-light);
    --imh-positive: var(--mya-positive);
    --imh-caution: var(--mya-caution);
    --imh-line: #E3E6EF;
    --imh-line-soft: #EEF0F5;
    --imh-win: #FFFFFF;
    --imh-sunk: #F8F9FC;
    --imh-track: #E7E9F1;
    --imh-bank: #D3D8E4;
    --imh-hover: #F1F2F7;
    --imh-cursor-fill: #0B0F19;
    --imh-cursor-edge: #FFFFFF;
    --imh-hero-bg: linear-gradient(158deg, color-mix(in srgb, var(--mya-violet) 7%, #FFFFFF) 0%, #FFFFFF 50%);
    --imh-hero-border: var(--mya-card-border);
    --imh-window-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 22px 44px -28px rgba(31, 36, 64, .32);
    --imh-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, Menlo, monospace;
}

[data-bs-theme="dark"] .imh {
    --imh-line: #283044;
    --imh-line-soft: #1F2536;
    --imh-win: #121722;
    --imh-sunk: #0F131C;
    --imh-track: #262C3E;
    --imh-bank: #363E55;
    --imh-hover: rgba(255, 255, 255, .04);
    --imh-cursor-fill: #FFFFFF;
    --imh-cursor-edge: #0B0F19;
    --imh-hero-bg: linear-gradient(158deg, color-mix(in srgb, var(--mya-violet) 11%, #151A26) 0%, #151A26 55%);
    --imh-hero-border: #262C3C;
    --imh-window-shadow: 0 22px 44px -28px rgba(0, 0, 0, .75);
}

@property --imh-n { syntax: "<integer>"; inherits: false; initial-value: 0; }

/* ------------------------------------------------------------------ The band */

.imh {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 2.25rem; align-items: center;
    padding: 1.75rem; margin-bottom: 1.5rem; border-radius: 20px;
    background: var(--imh-hero-bg); border: 1px solid var(--imh-hero-border);
    color: var(--imh-ink);
}
.imh *, .imh *::before, .imh *::after { box-sizing: border-box; }

.imh-copy { min-width: 0; }
.imh-eyebrow {
    display: inline-flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--imh-muted);
}
.imh-eyebrow i { color: var(--imh-accent); }
.imh-title {
    font-size: clamp(1.9rem, 2.35vw, 2.45rem); font-weight: 700; line-height: 1.1; letter-spacing: -.025em;
    margin: .6rem 0 .75rem; color: var(--imh-ink);
}
.imh-title span { color: var(--imh-accent); }
.imh-lead { font-size: .97rem; line-height: 1.6; color: var(--imh-muted); max-width: 34rem; margin: 0 0 1.25rem; }
.imh-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }

.imh-features {
    list-style: none; margin: 0; padding: 1.25rem 0 0; border-top: 1px solid var(--imh-line);
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem;
}
.imh-features li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .65rem; align-items: start; }
.imh-feature-glyph {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--imh-line); background: var(--imh-win); color: var(--imh-accent); font-size: .78rem;
}
.imh-feature-copy b { display: block; font-size: .84rem; font-weight: 600; color: var(--imh-ink); line-height: 1.3; }
.imh-feature-copy small { display: block; font-size: .76rem; line-height: 1.4; color: var(--imh-muted); margin-top: .1rem; }

.imh-stage { min-width: 0; }

/* ------------------------------------------------------------------ The window */

.imh-window {
    display: flex; flex-direction: column; overflow: hidden; border-radius: 14px;
    background: var(--imh-win); border: 1px solid var(--imh-line); box-shadow: var(--imh-window-shadow);
}

.imh-bar {
    display: flex; align-items: center; gap: .5rem; min-width: 0; height: 40px; padding: 0 .9rem;
    border-bottom: 1px solid var(--imh-line); font-size: .76rem; color: var(--imh-muted);
}
.imh-bar-chev { font-size: .5rem; color: var(--imh-faint); }
.imh-bar-crumb { white-space: nowrap; }
.imh-bar-src { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--imh-ink); white-space: nowrap; }
.imh-bar-src i { color: var(--imh-accent); font-size: .72rem; }
.imh-bar-file { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; font-family: var(--imh-mono); font-size: .72rem; }
.imh-bar-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-bar-file i { color: var(--imh-faint); }
.imh-sample {
    margin-left: auto; flex: none; padding: .12rem .45rem; border-radius: 5px; border: 1px solid var(--imh-line);
    font-size: .62rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--imh-faint);
}

.imh-body { display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 322px; }

/* The step rail: the page's own step line, Review opened into its three parts. */
.imh-rail {
    list-style: none; margin: 0; padding: .9rem .7rem; display: flex; flex-direction: column; gap: .1rem;
    background: var(--imh-sunk); border-right: 1px solid var(--imh-line);
}
.imh-rail-step { position: relative; }
.imh-rail-step:not(:last-child)::after {
    content: ""; position: absolute; left: calc(.45rem + 9.75px); top: calc(.42rem + 22px); bottom: calc(-.52rem + 1px); width: 1.5px;
    background: var(--imh-line); transition: background-color .3s ease;
}
.imh-rail-step.is-done::after { background: var(--imh-accent); }
.imh-rail-step > button {
    display: flex; align-items: center; gap: .6rem; width: 100%; padding: .42rem .45rem; border: 0; border-radius: 8px;
    background: none; color: var(--imh-muted); font: inherit; font-size: .82rem; font-weight: 500; text-align: left; cursor: pointer;
}
.imh-rail-step > button:hover { background: var(--imh-hover); color: var(--imh-ink); }
.imh-rail-step > button:focus-visible, .imh-rail-sub button:focus-visible, .imh-ctl:focus-visible { outline: none; box-shadow: var(--mya-focus); }
.imh-rail-dot {
    position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%;
    border: 1.5px solid var(--imh-line); background: var(--imh-win); color: var(--imh-faint); font-size: .66rem; font-weight: 700;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.imh-rail-dot b { font-weight: inherit; }
.imh-rail-dot i { display: none; font-size: .56rem; }
.imh-rail-step.is-done .imh-rail-dot { background: var(--imh-accent); border-color: var(--imh-accent); color: #FFFFFF; }
.imh-rail-step.is-done .imh-rail-dot b { display: none; }
.imh-rail-step.is-done .imh-rail-dot i { display: block; }
.imh-rail-step.is-current .imh-rail-dot { border-color: var(--imh-accent); color: var(--imh-accent); box-shadow: 0 0 0 3px var(--imh-accent-ring); }
.imh-rail-step.is-current > button { color: var(--imh-ink); font-weight: 600; }
.imh-rail-step.is-done > button { color: var(--imh-ink); }

.imh-rail-sub { list-style: none; margin: .05rem 0 .3rem 2.05rem; padding: 0; display: grid; gap: .05rem; }
.imh-rail-sub button {
    position: relative; width: 100%; padding: .22rem .5rem .22rem .75rem; border: 0; border-radius: 6px; background: none;
    font: inherit; font-size: .76rem; color: var(--imh-faint); text-align: left; cursor: pointer;
}
.imh-rail-sub button::before {
    content: ""; position: absolute; left: .2rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
    background: var(--imh-line);
}
.imh-rail-sub button:hover { background: var(--imh-hover); color: var(--imh-ink); }
.imh-rail-sub li.is-done button { color: var(--imh-muted); }
.imh-rail-sub li.is-done button::before { background: var(--imh-accent); }
.imh-rail-sub li.is-current button { color: var(--imh-accent); font-weight: 600; }
.imh-rail-sub li.is-current button::before { background: var(--imh-accent); box-shadow: 0 0 0 3px var(--imh-accent-ring); }

/* The pane and its scene */
.imh-pane { position: relative; min-width: 0; padding: 1.1rem 1.25rem; overflow: hidden; }
.imh-scene { min-width: 0; height: 100%; animation: imh-fade .3s ease-out both; }

/* The caption, controls and the scene's progress line */
.imh-foot {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
    padding: .8rem 1rem .85rem 1.15rem; border-top: 1px solid var(--imh-line);
}
.imh-caption { min-width: 0; }
.imh-caption-eyebrow { display: block; font-size: .66rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--imh-faint); }
.imh-caption-title { display: block; font-size: .92rem; font-weight: 600; color: var(--imh-ink); margin: .1rem 0 .15rem; }
.imh-caption-text {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: .8rem; line-height: 1.45; color: var(--imh-muted); min-height: 2.9em;
}
.imh-controls { display: flex; gap: .35rem; }
.imh-ctl {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--imh-line);
    background: var(--imh-win); color: var(--imh-muted); font-size: .7rem; cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.imh-ctl:hover { color: var(--imh-ink); border-color: var(--imh-faint); }
.imh-progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; overflow: hidden; }
.imh-progress-fill {
    display: block; height: 100%; background: var(--imh-accent); transform-origin: left; transform: scaleX(0);
    animation: imh-fill var(--dur, 6s) linear forwards;
}
.imh-window.is-paused .imh-progress-fill { animation-play-state: paused; }

/* ------------------------------------------------------------------ Shared parts */

.imh-a { animation: imh-in .45s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both; }

.imh-count { font-variant-numeric: tabular-nums; counter-reset: imh var(--imh-n); animation: imh-count 1.4s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both; }
.imh-count::after { content: counter(imh); }

.imh-meter { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--imh-track); overflow: hidden; }
.imh-meter.is-thin { height: 4px; }
.imh-meter > span {
    display: block; height: 100%; border-radius: inherit; background: var(--imh-accent); transform-origin: left; transform: scaleX(0);
    animation: imh-fill calc(var(--for, 1) * 1s) cubic-bezier(.4, .1, .2, 1) calc(var(--at, 0) * 1s) forwards;
}

.imh-swap { display: grid; align-items: center; }
.imh-swap > .is-before, .imh-swap > .is-after { grid-area: 1 / 1; }
.imh-swap > .is-before { animation: imh-out .2s ease-in calc(var(--at, 0) * 1s) forwards; }
.imh-swap > .is-after { animation: imh-in .35s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s + .12s) both; }

.imh-type { display: inline-block; max-width: 100%; white-space: nowrap; clip-path: inset(0 100% 0 0); animation: imh-type 1.5s steps(40, end) calc(var(--at, 0) * 1s) forwards; }
.imh-type.is-wrap { white-space: normal; animation-duration: 1.8s; }

.imh-tag {
    padding: .08rem .38rem; border-radius: 5px; border: 1px solid var(--imh-line);
    font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--imh-faint);
}

.imh-cursor {
    position: absolute; left: 58%; top: 50%; z-index: 4; width: 16px; height: 22px; pointer-events: none; opacity: 0;
    animation: imh-cursor 1.5s cubic-bezier(.3, .7, .2, 1) calc(var(--at, 0) * 1s) both;
}
.imh-cursor svg { display: block; fill: var(--imh-cursor-fill); stroke: var(--imh-cursor-edge); stroke-width: 1.2; stroke-linejoin: round; }
.imh-cursor-ring {
    position: absolute; left: -8px; top: -8px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--imh-accent);
    opacity: 0; animation: imh-ring .55s ease-out calc(var(--at, 0) * 1s + .9s) both;
}

/* ------------------------------------------------------------------ 1 App */

.imh-s-apps { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 1rem; align-items: start; }
.imh-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.imh-tile {
    position: relative; display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 46px; padding: .55rem .7rem;
    border: 1px solid var(--imh-line); border-radius: 10px; background: var(--imh-win);
    font-size: .8rem; font-weight: 600; color: var(--imh-ink);
}
.imh-tile > span:not([class]) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-tile > i { width: 1rem; text-align: center; color: var(--imh-muted); font-size: .82rem; flex: none; }
.imh-tile small { display: none; }
.imh-tile.is-statements { border-style: dashed; }
.imh-tile.is-pick {
    animation: imh-in .45s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both, imh-pick .25s ease-out 1.8s forwards;
}
.imh-tile.is-pick > i { animation: imh-pick-ink .25s ease-out 1.8s forwards; }
.imh-tile-check {
    position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    background: var(--imh-accent); color: #FFFFFF; font-size: .52rem; opacity: 0;
    animation: imh-pop .3s ease-out 1.85s both;
}

.imh-guide { padding: .8rem .9rem; border: 1px solid var(--imh-line); border-radius: 10px; background: var(--imh-sunk); }
.imh-guide-head { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--imh-ink); }
.imh-guide-head i { color: var(--imh-accent); font-size: .74rem; }
.imh-guide ol { list-style: none; margin: .65rem 0 .6rem; padding: 0; display: grid; gap: .5rem; }
.imh-guide li { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: baseline; gap: .5rem; font-size: .77rem; line-height: 1.4; color: var(--imh-ink); }
.imh-guide li b {
    flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid var(--imh-line); background: var(--imh-win); font-size: .6rem; color: var(--imh-muted);
}
.imh-guide code {
    font-family: var(--imh-mono); font-size: .7rem; color: var(--imh-ink); background: var(--imh-win);
    border: 1px solid var(--imh-line); border-radius: 4px; padding: 0 .25rem;
}
.imh-guide-foot { display: flex; align-items: center; gap: .4rem; padding-top: .55rem; border-top: 1px solid var(--imh-line); font-size: .71rem; color: var(--imh-muted); }
.imh-guide-foot i { color: var(--imh-faint); }

/* ------------------------------------------------------------------ 2 Upload */

.imh-s-upload { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; height: 100%; }
.imh-drop {
    display: grid; justify-items: center; gap: .75rem; padding: 1.25rem 1.1rem; text-align: center;
    border: 1.5px dashed var(--imh-line); border-radius: 12px; background: var(--imh-sunk);
}
.imh-drop-glyph {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--imh-line); background: var(--imh-win); color: var(--imh-accent); font-size: .85rem;
}
.imh-file {
    display: flex; align-items: center; gap: .6rem; max-width: 100%; padding: .55rem .75rem; text-align: left;
    border: 1px solid var(--imh-line); border-radius: 9px; background: var(--imh-win);
}
.imh-file > i { color: var(--imh-accent); font-size: 1rem; flex: none; }
.imh-file > span { min-width: 0; }
.imh-file b { display: block; font-size: .76rem; font-weight: 600; color: var(--imh-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-file small { display: block; font-size: .68rem; color: var(--imh-faint); }
.imh-drop-in { animation: imh-drop .75s cubic-bezier(.2, .8, .25, 1.1) calc(var(--at, 0) * 1s) both; }
.imh-drop .imh-meter { max-width: 280px; }
.imh-drop-count { font-size: .74rem; color: var(--imh-muted); }
.imh-drop-count b { font-weight: 700; color: var(--imh-ink); }

.imh-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.imh-checks li { display: flex; align-items: center; gap: .55rem; font-size: .8rem; color: var(--imh-ink); }
.imh-checks li > i { color: var(--imh-positive); font-size: .86rem; flex: none; }
.imh-checks em { font-style: normal; color: var(--imh-muted); }
.imh-checks li.is-quiet { margin-top: .2rem; padding-top: .65rem; border-top: 1px dashed var(--imh-line); color: var(--imh-muted); font-size: .76rem; }
.imh-checks li.is-quiet > i { color: var(--imh-faint); }

/* ------------------------------------------------------------------ 3 Columns */

.imh-s-map { display: grid; gap: .42rem; }
.imh-map-head, .imh-map-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, .8fr); gap: .5rem; align-items: center; }
.imh-map-head span { font-size: .65rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--imh-faint); }
.imh-map-from { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.imh-map-from code {
    font-family: var(--imh-mono); font-size: .71rem; color: var(--imh-ink); padding: .26rem .5rem;
    border: 1px solid var(--imh-line); border-radius: 6px; background: var(--imh-sunk); white-space: nowrap;
}
.imh-wire { position: relative; height: 1.5px; background: var(--imh-track); }
.imh-wire > span {
    position: absolute; inset: 0; background: var(--imh-accent); transform-origin: left; transform: scaleX(0);
    animation: imh-fill .45s ease-out calc(var(--at, 0) * 1s) forwards;
}
.imh-map-to {
    display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .28rem .55rem;
    border: 1px solid var(--imh-accent-line); border-radius: 6px; background: var(--imh-win);
    font-size: .78rem; font-weight: 600; color: var(--imh-ink);
}
.imh-map-to i { color: var(--imh-positive); font-size: .68rem; }
.imh-preview {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .5rem; padding: .55rem .75rem;
    border: 1px solid var(--imh-line); border-radius: 8px; background: var(--imh-sunk); font-size: .76rem; color: var(--imh-muted);
}
.imh-preview small { font-size: .62rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--imh-faint); }
.imh-preview .is-strong { font-weight: 600; color: var(--imh-ink); }
.imh-preview .is-amt { margin-left: auto; font-weight: 600; color: var(--imh-ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 4 Accounts */

.imh-s-lanes { display: grid; gap: .65rem; align-content: start; }
.imh-lane { display: grid; grid-template-columns: 148px minmax(40px, 1fr) 222px; gap: .6rem; align-items: center; }
.imh-lane-src, .imh-lane-dest { border: 1px solid var(--imh-line); border-radius: 9px; padding: .5rem .65rem; background: var(--imh-win); min-width: 0; }
.imh-lane-src b, .imh-lane-dest b { display: block; font-size: .8rem; font-weight: 600; color: var(--imh-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-lane-src small, .imh-lane-dest small { display: block; font-size: .7rem; color: var(--imh-muted); }
.imh-lane-dest { display: flex; align-items: center; gap: .55rem; }
.imh-lane-dest > span { min-width: 0; }
.imh-lane-dest > i {
    flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
    border: 1px solid var(--imh-line); color: var(--imh-accent); font-size: .74rem;
}
.imh-lane.is-existing .imh-lane-dest > i { color: var(--imh-ink); }
.imh-lane.is-skip .imh-lane-src { opacity: .6; }
.imh-lane.is-skip .imh-lane-dest { border-style: dashed; background: transparent; }
.imh-lane.is-skip .imh-lane-dest > i, .imh-lane.is-skip .imh-lane-dest b { color: var(--imh-faint); }
.imh-lane-track { position: relative; height: 2px; border-radius: 2px; background: var(--imh-track); }
.imh-lane.is-skip .imh-lane-track { background: repeating-linear-gradient(90deg, var(--imh-line) 0 4px, transparent 4px 8px); }
.imh-lane-dot {
    position: absolute; top: -2.5px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--imh-accent); opacity: 0;
    animation: imh-travel 1.1s ease-in-out calc(var(--at, 0) * 1s) 3 both;
}
.imh-lane-notes { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .55rem; padding-top: .7rem; border-top: 1px solid var(--imh-line-soft); }
.imh-lane-notes span { display: inline-flex; align-items: center; gap: .45rem; font-size: .76rem; color: var(--imh-muted); }
.imh-lane-notes i { color: var(--imh-accent); font-size: .74rem; }

/* ------------------------------------------------------------------ Review: Categories */

.imh-s-cats { display: grid; align-content: start; }
.imh-cats-head, .imh-cat { display: grid; grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1.35fr); gap: .75rem; align-items: center; }
.imh-cats-head { padding: 0 .55rem .4rem; }
.imh-cats-head span { font-size: .65rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--imh-faint); }
.imh-cats-head span:nth-child(2) { text-align: right; }
.imh-cat { padding: .36rem .55rem; border-top: 1px solid var(--imh-line-soft); font-size: .8rem; min-height: 38px; }
.imh-cat-from { font-weight: 600; color: var(--imh-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-cat-rows { text-align: right; color: var(--imh-muted); font-variant-numeric: tabular-nums; }
.imh-cat .is-before { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--imh-faint); }
.imh-cat .is-before i { animation: imh-spin .9s linear infinite; }
.imh-cat-to {
    display: inline-flex; align-items: center; gap: .45rem; justify-self: start; max-width: 100%; padding: .2rem .55rem;
    border: 1px solid var(--imh-line); border-radius: 6px; font-size: .76rem; font-weight: 600; color: var(--imh-ink); white-space: nowrap;
}
.imh-cat-to i { color: var(--imh-muted); font-size: .7rem; }
.imh-cat.is-tag .imh-cat-to { border-style: dashed; }
.imh-cat.is-tag .imh-cat-to i { color: var(--imh-accent); }
.imh-cat.is-open .imh-cat-to { color: var(--imh-caution); border-color: color-mix(in srgb, var(--imh-caution) 45%, transparent); }
.imh-cat.is-open .imh-cat-to i { color: var(--imh-caution); }
.imh-cats-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: .65rem; padding: .65rem .55rem 0; border-top: 1px solid var(--imh-line-soft); }
.imh-cats-meter { display: flex; align-items: center; gap: .65rem; width: 260px; max-width: 100%; }
.imh-cats-meter small { font-size: .72rem; color: var(--imh-muted); white-space: nowrap; }
.imh-cats-note { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--imh-muted); }
.imh-cats-note i { color: var(--imh-accent); }

/* ------------------------------------------------------------------ Review: Import Assist */

.imh-s-assist { display: grid; gap: .5rem; align-content: start; }
.imh-assist-head { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding-bottom: .65rem; border-bottom: 1px solid var(--imh-line-soft); }
.imh-assist-head b { font-size: .88rem; font-weight: 600; color: var(--imh-ink); }
.imh-assist-glyph { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--imh-accent); color: #FFFFFF; font-size: .7rem; }
.imh-assist-status { margin-left: auto; min-width: 0; font-size: .75rem; color: var(--imh-muted); }
.imh-finding {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: .7rem; align-items: center;
    padding: .55rem .65rem; border: 1px solid var(--imh-line); border-radius: 10px; background: var(--imh-win);
}
.imh-finding-glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--imh-line); color: var(--imh-muted); font-size: .76rem; }
.imh-finding-text { min-width: 0; }
.imh-finding-text b { display: block; font-size: .8rem; font-weight: 600; color: var(--imh-ink); }
.imh-finding-text small { display: block; font-size: .72rem; color: var(--imh-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-apply { position: relative; min-width: 86px; justify-items: end; }
.imh-apply > .is-before { padding: .28rem .75rem; border: 1px solid var(--imh-accent-line); border-radius: 7px; font-size: .74rem; font-weight: 600; color: var(--imh-accent); }
.imh-apply > .is-after { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .2rem; font-size: .74rem; font-weight: 600; color: var(--imh-positive); }
.imh-apply .imh-cursor { left: 42%; top: 46%; }
.imh-assist-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .25rem; }
.imh-assist-foot span { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--imh-muted); }
.imh-assist-foot i { color: var(--imh-accent); }

/* ------------------------------------------------------------------ Review: Duplicates and Import */

.imh-s-review { display: grid; align-content: start; }
.imh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.imh-stat { padding: .55rem .75rem; border: 1px solid var(--imh-line); border-radius: 10px; background: var(--imh-win); }
.imh-stat b { display: block; font-size: 1.2rem; font-weight: 700; color: var(--imh-ink); line-height: 1.2; }
.imh-stat small { display: block; font-size: .71rem; color: var(--imh-muted); }
.imh-stat.is-ready b { color: var(--imh-positive); }
.imh-rows { margin-top: .6rem; border: 1px solid var(--imh-line); border-radius: 10px; overflow: hidden; }
.imh-row {
    display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(0, .85fr) 82px 124px; gap: .6rem; align-items: center;
    padding: .42rem .7rem; font-size: .78rem; border-top: 1px solid var(--imh-line-soft);
}
.imh-row:first-child { border-top: 0; }
.imh-row-date { color: var(--imh-faint); font-variant-numeric: tabular-nums; }
.imh-row-name { font-weight: 600; color: var(--imh-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-row-cat { color: var(--imh-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imh-row-amt { text-align: right; font-weight: 600; color: var(--imh-ink); font-variant-numeric: tabular-nums; }
.imh-row-amt.is-in { color: var(--imh-positive); }
.imh-row-tag {
    justify-self: end; padding: .12rem .45rem; border-radius: 5px; border: 1px solid var(--imh-line);
    font-size: .67rem; font-weight: 600; color: var(--imh-muted); white-space: nowrap;
    animation: imh-in .3s ease-out calc(var(--at, 0) * 1s) both;
}
.imh-row.is-ready .imh-row-tag { color: var(--imh-positive); border-color: color-mix(in srgb, var(--imh-positive) 38%, transparent); }
.imh-row.is-dupe .imh-row-tag { color: var(--imh-caution); border-color: color-mix(in srgb, var(--imh-caution) 40%, transparent); }
.imh-row.is-dupe, .imh-row.is-skip {
    animation: imh-in .45s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both, imh-dim .4s ease-out 2.6s forwards;
}
.imh-row.is-dupe .imh-row-name, .imh-row.is-dupe .imh-row-amt { text-decoration: line-through; text-decoration-color: var(--imh-faint); }
.imh-commit { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; }
.imh-import-btn {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 8px;
    background: var(--ci-btn-fill) border-box; color: var(--ci-btn-text); font-size: .78rem; font-weight: 600;
    animation: imh-in .45s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both, imh-press .3s ease-out 4.7s;
    box-shadow: var(--ci-btn-edge);
}
.imh-import-btn .imh-cursor { left: 62%; top: 55%; }
.imh-commit-run { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.imh-commit-run small { font-size: .71rem; color: var(--imh-muted); }

/* ------------------------------------------------------------------ Done */

.imh-s-done { display: grid; align-content: start; }
.imh-done-head { display: flex; align-items: center; gap: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--imh-line-soft); }
.imh-done-check {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--imh-positive); color: #FFFFFF; font-size: .85rem; animation: imh-pop .4s ease-out .2s both;
}
.imh-done-title { min-width: 0; }
.imh-done-title b { display: block; font-size: .96rem; font-weight: 700; color: var(--imh-ink); }
.imh-done-title small { display: block; font-size: .72rem; color: var(--imh-muted); }
.imh-undo {
    margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem;
    border: 1px solid var(--imh-line); border-radius: 7px; font-size: .74rem; font-weight: 600; color: var(--imh-muted);
}
.imh-done-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .8rem; margin-top: .8rem; }
.imh-history, .imh-brief { padding: .7rem .8rem; border: 1px solid var(--imh-line); border-radius: 10px; background: var(--imh-win); min-width: 0; }
.imh-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .75rem; font-size: .76rem; }
.imh-history-head b { font-weight: 600; color: var(--imh-ink); }
.imh-legend { display: inline-flex; align-items: center; gap: .35rem; font-size: .68rem; color: var(--imh-muted); }
.imh-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.imh-legend i + i, .imh-legend i:not(:first-child) { margin-left: .4rem; }
.imh-legend i.is-imported, .imh-bars i.is-imported { background: color-mix(in srgb, var(--imh-accent) 82%, transparent); }
.imh-legend i.is-bank, .imh-bars i.is-bank { background: var(--imh-bank); }
.imh-bars { display: flex; align-items: flex-end; gap: 3px; height: 108px; margin-top: .65rem; }
.imh-bars i { flex: 1; height: var(--h); border-radius: 2px 2px 0 0; transform-origin: bottom; }
.imh-bars i.is-imported { animation: imh-grow .5s cubic-bezier(.2, .7, .2, 1) calc(var(--at, 0) * 1s) both; }
.imh-axis { display: flex; justify-content: space-between; margin-top: .35rem; font-size: .64rem; color: var(--imh-faint); font-variant-numeric: tabular-nums; }
.imh-brief { display: grid; align-content: start; gap: .6rem; }
.imh-brief-head { display: flex; align-items: center; gap: .4rem; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--imh-accent); }
.imh-brief .imh-type { font-size: .86rem; font-weight: 500; line-height: 1.45; color: var(--imh-ink); }
.imh-brief-uses { display: flex; flex-wrap: wrap; gap: .35rem; }
.imh-brief-uses span {
    display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .45rem; border: 1px solid var(--imh-line); border-radius: 6px;
    font-size: .7rem; font-weight: 600; color: var(--imh-muted);
}
.imh-brief-uses i { color: var(--imh-accent); font-size: .66rem; }

/* ------------------------------------------------------------------ Keyframes */

@keyframes imh-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes imh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes imh-out { to { opacity: 0; visibility: hidden; } }
@keyframes imh-fill { to { transform: scaleX(var(--w, 1)); } }
@keyframes imh-count { from { --imh-n: 0; } to { --imh-n: var(--to); } }
@keyframes imh-type { to { clip-path: inset(0 0 0 0); } }
@keyframes imh-spin { to { transform: rotate(360deg); } }
@keyframes imh-pop { from { opacity: 0; transform: scale(.5); } 70% { opacity: 1; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes imh-pick { to { border-color: var(--imh-accent); box-shadow: 0 0 0 3px var(--imh-accent-ring); } }
@keyframes imh-pick-ink { to { color: var(--imh-accent); } }
@keyframes imh-drop { from { opacity: 0; transform: translateY(-24px) scale(.96); } 70% { opacity: 1; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes imh-travel { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 7px); opacity: 0; } }
@keyframes imh-dim { to { opacity: .55; } }
@keyframes imh-press { 50% { transform: scale(.96); } }
@keyframes imh-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes imh-cursor {
    0% { opacity: 0; transform: translate(56px, 36px); }
    15% { opacity: 1; }
    55% { transform: none; }
    61% { transform: scale(.86); }
    68% { transform: none; }
    86% { opacity: 1; }
    100% { opacity: 0; transform: none; }
}
@keyframes imh-ring { 0% { opacity: 0; transform: scale(.3); } 12% { opacity: .9; } 100% { opacity: 0; transform: scale(1.6); } }

/* ------------------------------------------------------------------ Responsive */

@media (max-width: 1320px) {
    .imh { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .imh-lead { max-width: 46rem; }
    .imh-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .imh { padding: 1.25rem; }
    .imh-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .imh-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .imh-rail { flex-direction: row; gap: .15rem; padding: .45rem .5rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--imh-line); }
    .imh-rail-step::after, .imh-rail-sub { display: none; }
    .imh-rail-step > button { padding: .35rem .5rem; white-space: nowrap; }
    .imh-pane { min-height: 330px; }
    .imh-s-apps, .imh-s-upload { grid-template-columns: minmax(0, 1fr); }
    .imh-lane { grid-template-columns: 128px minmax(24px, 1fr) minmax(0, 190px); }
}

@media (max-width: 640px) {
    .imh-features { grid-template-columns: minmax(0, 1fr); }
    .imh-bar-file, .imh-bar-crumb, .imh-bar-crumb + .imh-bar-chev, .imh-bar-src + .imh-bar-chev { display: none; }
    .imh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .imh-lane { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .imh-lane-track { display: none; }
    .imh-row { grid-template-columns: 44px minmax(0, 1fr) 76px; }
    .imh-row-cat, .imh-row-tag { display: none; }
    .imh-done-grid { grid-template-columns: minmax(0, 1fr); }
    .imh-commit { flex-wrap: wrap; }
    .imh-commit-run { flex-basis: 100%; }
    .imh-foot { grid-template-columns: minmax(0, 1fr); }
    .imh-rail-label { display: none; }
    .imh-rail-step.is-current .imh-rail-label { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
    .imh *, .imh *::before, .imh *::after {
        animation-duration: 1ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
}
