:root {
    color-scheme: dark;
    --ink: #101316;
    --ink-soft: #171b1e;
    --panel: #1e2428;
    --panel-light: #262d31;
    --line: rgba(218, 231, 231, 0.13);
    --text: #edf2f0;
    --muted: #929d9e;
    --steel: #c5cecc;
    --signal: #71c8c7;
    --danger: #f0837d;
    --success: #82c7a5;
    --display: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", sans-serif;
    --body: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
    --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --shadow: 0 34px 80px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ink);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 4%, rgba(113, 200, 199, 0.07), transparent 24rem),
        linear-gradient(145deg, #15191c 0%, #0e1113 68%);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--signal);
    font-family: var(--utility);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 2.65rem;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(226, 239, 236, 0.25);
    border-radius: 50%;
    background: linear-gradient(145deg, #30383b, #121518 70%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), 0 8px 22px rgba(0, 0, 0, 0.32);
    color: #dfe7e5;
    font-family: var(--utility);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: -0.08em;
}

.brand-mark::before {
    position: absolute;
    width: 42%;
    aspect-ratio: 1;
    border: 1px solid rgba(113, 200, 199, 0.55);
    border-radius: 50%;
    content: "";
}

.brand-mark span {
    position: relative;
    z-index: 1;
    padding: 0.1rem;
    background: #1a1f22;
}

.brand-mark--large {
    width: 4rem;
}

.notice {
    padding: 0.85rem 1rem;
    border: 1px solid currentColor;
    border-radius: 0.75rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.notice--error {
    color: #f5a19c;
    background: rgba(240, 131, 125, 0.08);
}

.notice--success {
    color: #9ed5b9;
    background: rgba(130, 199, 165, 0.08);
}

.primary-button {
    display: inline-flex;
    min-height: 3.35rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.8rem 1rem 0.8rem 1.25rem;
    border: 0;
    border-radius: 0.8rem;
    background: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
    color: #111719;
    cursor: pointer;
    font-weight: 750;
    transition: transform 180ms ease, background-color 180ms ease;
}

.primary-button:hover {
    background: #fff;
    transform: translateY(-2px);
}

.primary-button span {
    color: #3a4a4d;
    font-size: 1.2rem;
}

/* Login */

.login-shell {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1.25fr) minmax(25rem, 0.75fr);
}

.login-visual {
    position: relative;
    display: flex;
    min-height: 48rem;
    flex-direction: column;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 4.5rem);
    border-right: 1px solid var(--line);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 38%),
        repeating-linear-gradient(90deg, transparent 0, transparent calc(20% - 1px), rgba(255,255,255,.025) 20%),
        #171c1f;
}

.login-visual::after {
    position: absolute;
    right: -8rem;
    bottom: -5rem;
    width: 38rem;
    height: 9rem;
    border-radius: 50%;
    background: linear-gradient(90deg, #3f251a, #9e6743 45%, #4b2d20);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 30px 60px rgba(0,0,0,.5);
    content: "";
    transform: rotate(-6deg);
}

.visual-kicker {
    margin: clamp(3rem, 8vh, 7rem) 0 0.7rem;
    color: var(--muted);
    font-family: var(--utility);
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.login-visual h1 {
    position: relative;
    z-index: 2;
    max-width: 7em;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(4.2rem, 8vw, 8.8rem);
    font-stretch: condensed;
    font-weight: 700;
    letter-spacing: -0.075em;
    line-height: 0.79;
    text-transform: uppercase;
}

.login-tank-wrap {
    position: absolute;
    z-index: 1;
    right: clamp(1rem, 7vw, 8rem);
    bottom: 3rem;
    display: grid;
    width: min(42vw, 32rem);
    aspect-ratio: 1;
    place-items: center;
}

.login-tank {
    position: relative;
    z-index: 2;
    width: 78%;
    filter: drop-shadow(0 34px 28px rgba(0, 0, 0, 0.56));
    object-fit: contain;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(113, 200, 199, 0.16);
    border-radius: 50%;
}

.orbit--one {
    width: 95%;
    aspect-ratio: 1;
}

.orbit--two {
    width: 68%;
    aspect-ratio: 1;
    border-color: rgba(218, 137, 89, 0.22);
}

.position-index {
    position: relative;
    z-index: 3;
    display: flex;
    width: min(22rem, 45%);
    justify-content: space-between;
    margin: auto 0 0;
    padding: 0 0 0.5rem;
    list-style: none;
    color: #6d7778;
    font-family: var(--utility);
    font-size: 0.68rem;
}

.position-index .active {
    color: var(--signal);
}

.login-panel {
    display: grid;
    min-height: 100%;
    place-items: center;
    padding: 2rem;
    background: #111518;
}

.login-card {
    width: min(100%, 24rem);
}

.mobile-brand {
    display: none;
}

.login-card h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 650;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.login-intro {
    margin: 1rem 0 2rem;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 1.1rem;
    margin-top: 1.3rem;
}

.login-form label,
.edit-form label {
    display: grid;
    gap: 0.5rem;
}

.login-form label > span:first-child,
.edit-form label > span:first-child {
    color: var(--steel);
    font-family: var(--utility);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: #1a1f22;
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

input {
    height: 3.35rem;
    padding: 0 0.95rem;
}

textarea {
    min-height: 6.6rem;
    padding: 0.9rem 0.95rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(113, 200, 199, 0.72);
    box-shadow: 0 0 0 3px rgba(113, 200, 199, 0.1);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 5rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    padding: 0.4rem 0.55rem;
    border: 0;
    background: transparent;
    color: var(--signal);
    cursor: pointer;
    font-family: var(--utility);
    font-size: 0.65rem;
    transform: translateY(-50%);
}

.local-note {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1.5rem 0 0;
    color: #6f797b;
    font-size: 0.72rem;
}

.local-note span {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(130, 199, 165, 0.09);
}

/* Dashboard */

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 5rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem clamp(1rem, 4vw, 4rem);
    border-bottom: 1px solid var(--line);
    background: rgba(16, 19, 22, 0.86);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.brand > span:last-child {
    display: grid;
}

.brand strong {
    font-size: 0.92rem;
    letter-spacing: -0.02em;
}

.brand small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-family: var(--utility);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-nav {
    position: absolute;
    left: 50%;
    display: flex;
    gap: 0.2rem;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 99rem;
    background: rgba(255, 255, 255, 0.025);
    transform: translateX(-50%);
}

.section-nav a {
    padding: 0.48rem 0.8rem;
    border-radius: 99rem;
    color: #8e999a;
    font-family: var(--utility);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, color 180ms ease;
}

.section-nav a:hover {
    background: rgba(113, 200, 199, 0.1);
    color: var(--text);
}

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ba6a6;
    font-family: var(--utility);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

.sync-status i {
    width: 0.43rem;
    height: 0.43rem;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(130, 199, 165, 0.08);
}

.install-button {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 99rem;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.72rem;
}

.icon-button,
.dialog-close {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: #a9b3b4;
    cursor: pointer;
}

.icon-button svg,
.dialog-close svg,
.edit-trigger svg {
    width: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.dashboard {
    width: min(100%, 108rem);
    margin: 0 auto;
    padding: clamp(2.3rem, 5vw, 5.5rem) clamp(1rem, 4vw, 4rem) 1.5rem;
}

.dashboard-heading {
    display: grid;
    grid-template-columns: 1fr minmax(15rem, 24rem);
    align-items: end;
    gap: 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.dashboard-heading h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3.4rem, 7vw, 7.7rem);
    font-weight: 650;
    letter-spacing: -0.075em;
    line-height: 0.82;
    text-transform: uppercase;
}

.dashboard-heading h1 em {
    color: transparent;
    -webkit-text-stroke: 1px #829092;
    font-style: normal;
}

.heading-note {
    max-width: 34ch;
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.dashboard-notice {
    width: fit-content;
    margin: -2rem 0 2rem;
}

.rack-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.rack-labels h2 {
    margin: 0;
    font-family: var(--utility);
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.rack-labels > span {
    display: none;
    color: var(--muted);
    font-size: 0.68rem;
}

.fill-rack {
    --gap: clamp(0.65rem, 1vw, 1.15rem);
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.fill-card {
    --slot: var(--signal);
    min-width: 0;
}

.slot-1 { --slot: #6ac6c7; }
.slot-2 { --slot: #d8a25d; }
.slot-3 { --slot: #9e91d6; }
.slot-4 { --slot: #d47668; }
.slot-5 { --slot: #7fb68f; }

.fill-card article {
    position: relative;
    display: flex;
    min-height: 35rem;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
        #191e21;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
    transition: border-color 220ms ease, transform 220ms ease, background-color 220ms ease;
}

.fill-card article::before {
    position: absolute;
    top: 0;
    left: 1rem;
    width: 2.5rem;
    height: 2px;
    background: var(--slot);
    box-shadow: 0 0 12px var(--slot);
    content: "";
}

.fill-card article:hover {
    border-color: rgba(218, 231, 231, 0.24);
    background-color: #1c2225;
    transform: translateY(-5px);
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slot-number {
    color: var(--slot);
    font-family: var(--utility);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.fill-state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #899596;
    font-family: var(--utility);
    font-size: 0.57rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fill-state i {
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 50%;
    background: var(--slot);
    box-shadow: 0 0 8px var(--slot);
}

.is-empty .fill-state i {
    background: #657073;
    box-shadow: none;
}

.tank-stage {
    position: relative;
    display: grid;
    min-height: 18.5rem;
    place-items: center;
    margin: 0.3rem -0.5rem 0.25rem;
    overflow: hidden;
}

.tank-stage::after {
    position: absolute;
    right: 10%;
    bottom: 9%;
    left: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
    content: "";
}

.tank-glow {
    position: absolute;
    width: 8.5rem;
    height: 12rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--slot) 18%, transparent);
    filter: blur(2.3rem);
    opacity: 0.6;
}

.tank-image {
    position: relative;
    z-index: 2;
    width: min(100%, 14rem);
    max-height: 18rem;
    filter: drop-shadow(0 22px 16px rgba(0, 0, 0, 0.5));
    object-fit: contain;
    transition: transform 300ms cubic-bezier(.2,.8,.2,1);
}

.fill-card article:hover .tank-image {
    transform: translateY(-4px) scale(1.02);
}

.liquid-level {
    position: absolute;
    z-index: 3;
    right: 18%;
    bottom: 14%;
    width: 0.24rem;
    height: 28%;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,.8), var(--slot));
    box-shadow: 0 0 10px var(--slot);
    opacity: 0.58;
}

.is-empty .liquid-level {
    height: 3%;
    opacity: 0.2;
}

.fill-copy {
    min-height: 9rem;
}

.fill-copy-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
}

.fill-copy-text {
    min-width: 0;
}

.package-thumb {
    position: relative;
    width: 3.65rem;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--slot) 35%, var(--line));
    border-radius: 0.65rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--slot) 11%, transparent), transparent 58%),
        #111518;
    box-shadow:
        inset 0 0 0 0.22rem rgba(5, 8, 9, 0.34),
        0 0.7rem 1.2rem rgba(0, 0, 0, 0.24);
    color: inherit;
    cursor: zoom-in;
}

.package-thumb::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.12), transparent 35%);
    content: "";
    pointer-events: none;
}

.package-thumb img {
    width: 100%;
    height: 100%;
    padding: 0.22rem;
    border-radius: inherit;
    filter: saturate(0.94) contrast(1.03);
    object-fit: contain;
    transition: filter 240ms ease, transform 280ms cubic-bezier(.2,.8,.2,1);
}

.fill-card article:hover .package-thumb img {
    filter: saturate(1) contrast(1.05);
    transform: scale(1.05);
}

.package-thumb:focus-visible {
    outline-color: var(--slot);
}

.copy-label {
    margin: 0 0 0.4rem;
    color: #697577;
    font-family: var(--utility);
    font-size: 0.56rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.fill-copy h3 {
    min-height: 2.5em;
    margin: 0;
    overflow-wrap: anywhere;
    font-family: var(--display);
    font-size: clamp(1.25rem, 1.8vw, 1.85rem);
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1.03;
}

.aroma-name {
    min-height: 2.8em;
    margin: 0.45rem 0 0;
    overflow-wrap: anywhere;
    color: var(--slot);
    font-size: 0.76rem;
    font-weight: 620;
    line-height: 1.4;
}

.fill-rating {
    display: flex;
    min-height: 1.3rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.75rem;
    color: #7a8586;
    font-family: var(--utility);
    font-size: 0.54rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rating-stars {
    display: inline-flex;
    gap: 0.14rem;
    color: #41494b;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.rating-stars .is-active {
    color: #e6b45d;
    filter: drop-shadow(0 0 5px rgba(230, 180, 93, 0.3));
}

.updated-at {
    margin: 0.75rem 0 0;
    color: #626e70;
    font-family: var(--utility);
    font-size: 0.54rem;
}

.edit-trigger {
    display: flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    color: #cbd2d1;
    font-size: 0.72rem;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease;
}

.edit-trigger:hover {
    background: var(--slot);
    color: #101416;
}

/* Collapsible collections */

.collection-section {
    margin-top: clamp(3rem, 7vw, 6rem);
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 6rem;
}

.recipes-section {
    margin-top: 1.25rem;
}

.collection-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: clamp(1.3rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 92% 0%, rgba(113, 200, 199, 0.07), transparent 18rem),
        #171c1f;
    cursor: pointer;
    list-style: none;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.collection-summary::-webkit-details-marker {
    display: none;
}

.collection-summary:hover {
    border-color: rgba(113, 200, 199, 0.32);
}

.collection-section[open] > .collection-summary {
    border-color: rgba(113, 200, 199, 0.24);
    background-color: #1a2023;
}

.collection-summary h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3.2rem, 7vw, 7rem);
    font-weight: 650;
    letter-spacing: -0.075em;
    line-height: 0.84;
    text-transform: uppercase;
}

.collection-summary h2 em {
    color: transparent;
    -webkit-text-stroke: 1px #829092;
    font-style: normal;
}

.collection-summary > div > p:last-child {
    max-width: 56ch;
    margin: 1.4rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.collection-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #aeb9b8;
    font-family: var(--utility);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.collection-toggle svg {
    width: 1.25rem;
    fill: none;
    stroke: var(--signal);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: transform 180ms ease;
}

.collection-section[open] > .collection-summary .collection-toggle svg {
    transform: rotate(180deg);
}

.collection-body {
    padding-top: 1.25rem;
}

.recipes-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Liquid lists */

.preference-add-form {
    display: grid;
    grid-template-columns: minmax(11rem, 1.15fr) minmax(9rem, 0.7fr) minmax(14rem, 1.35fr) auto;
    align-items: end;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: #181d20;
}

.preference-add-form label,
.preference-editor label {
    display: grid;
    gap: 0.45rem;
}

.preference-add-form label > span,
.preference-editor label > span {
    color: var(--steel);
    font-family: var(--utility);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.preference-add-form label small {
    color: #687476;
    font-size: 0.52rem;
    letter-spacing: 0;
    text-transform: none;
}

.preference-add-form select,
.preference-add-form input,
.preference-editor select,
.preference-editor input {
    height: 3rem;
    min-width: 0;
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: #111618;
    color: var(--text);
}

.preference-add-button {
    min-height: 3rem;
    white-space: nowrap;
}

.preference-add-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    transform: none;
}

.preference-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.preference-group {
    min-width: 0;
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid var(--line);
    border-top: 2px solid var(--success);
    border-radius: 1rem;
    background:
        linear-gradient(145deg, rgba(130, 199, 165, 0.055), transparent 13rem),
        #171c1f;
}

.preference-group--skip {
    border-top-color: var(--danger);
    background:
        linear-gradient(145deg, rgba(240, 131, 125, 0.05), transparent 13rem),
        #171c1f;
}

.preference-group > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.preference-group h3 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
}

.preference-group header p {
    margin: 0.25rem 0 0;
    color: #778284;
    font-size: 0.68rem;
}

.preference-group header > strong {
    display: grid;
    min-width: 2rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #b8c2c1;
    font-family: var(--utility);
    font-size: 0.62rem;
}

.preference-items {
    display: grid;
    gap: 0.7rem;
}

.preference-empty {
    margin: 0;
    padding: 1.4rem 1rem;
    border: 1px dashed var(--line);
    border-radius: 0.75rem;
    color: #667173;
    font-size: 0.7rem;
    text-align: center;
}

.preference-item {
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.78rem;
    background: rgba(9, 12, 13, 0.28);
}

.preference-item-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.preference-item h4 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.84rem;
}

.preference-item-copy p {
    margin: 0.3rem 0 0;
    color: #828d8e;
    font-size: 0.68rem;
    line-height: 1.45;
}

.preference-rating {
    flex: none;
    color: #e6b45d;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
}

.preference-shop-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    color: var(--signal);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
}

.preference-shop-link:hover {
    text-decoration: underline;
}

.preference-editor {
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.preference-editor > summary {
    color: #778284;
    cursor: pointer;
    font-family: var(--utility);
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.preference-editor form {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) minmax(12rem, 1.3fr);
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.preference-editor-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 0.7rem;
}

.preference-editor-actions button {
    padding: 0.55rem 0;
    border: 0;
    background: transparent;
    color: var(--signal);
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
}

.preference-editor-actions .preference-delete-button {
    color: var(--danger);
}

/* Recipes */

.new-recipe-button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(113, 200, 199, 0.3);
    border-radius: 0.75rem;
    background: rgba(113, 200, 199, 0.08);
    color: #b9e2df;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 180ms ease, transform 180ms ease;
}

.new-recipe-button:hover {
    background: rgba(113, 200, 199, 0.15);
    transform: translateY(-2px);
}

.new-recipe-button svg,
.recipe-edit-trigger svg {
    width: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.recipe-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 26rem;
    flex-direction: column;
    padding: clamp(1.1rem, 2vw, 1.5rem);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background:
        radial-gradient(circle at 90% 0%, rgba(113, 200, 199, 0.065), transparent 12rem),
        #191e21;
}

.recipe-card::before {
    position: absolute;
    top: 0;
    left: 1.5rem;
    width: 3rem;
    height: 2px;
    background: linear-gradient(90deg, #d8a25d 0 25%, #d47668 25% 50%, #6ac6c7 50% 75%, #9e91d6 75%);
    content: "";
}

.recipe-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #687476;
    font-family: var(--utility);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recipe-card-header strong {
    color: #b7c1c0;
    font-size: 0.68rem;
}

.recipe-card h3 {
    margin: 1.35rem 0 0;
    overflow-wrap: anywhere;
    font-family: var(--display);
    font-size: clamp(1.7rem, 2.5vw, 2.5rem);
    font-weight: 650;
    letter-spacing: -0.05em;
    line-height: 0.96;
}

.recipe-aroma {
    min-height: 2.8em;
    margin: 0.6rem 0 0;
    color: var(--signal);
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.4;
}

.recipe-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 1rem 0;
    border-block: 1px solid var(--line);
}

.recipe-result div {
    display: grid;
    gap: 0.3rem;
}

.recipe-result span,
.mix-readout span {
    color: #657173;
    font-family: var(--utility);
    font-size: 0.55rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.recipe-result strong {
    font-family: var(--display);
    font-size: 1.55rem;
    letter-spacing: -0.04em;
}

.recipe-result small {
    color: #889394;
    font-family: var(--utility);
    font-size: 0.55rem;
    letter-spacing: 0;
}

.ingredient-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 0;
}

.ingredient {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.62rem 0.7rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.7rem;
}

.ingredient dt::before {
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    content: "";
    box-shadow: 0 0 8px currentColor;
}

.ingredient dd {
    margin: 0;
    color: #c8d0cf;
    font-family: var(--utility);
    font-size: 0.62rem;
}

.ingredient--aroma dt { color: #d8a25d; }
.ingredient--nicotine dt { color: #d47668; }
.ingredient--vg dt { color: #6ac6c7; }
.ingredient--pg dt { color: #9e91d6; }

.recipe-notes {
    margin: 1rem 0;
    color: #788385;
    font-size: 0.7rem;
    line-height: 1.45;
}

.recipe-edit-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    color: #aeb8b7;
    font-size: 0.7rem;
    font-weight: 650;
    text-decoration: none;
}

.recipe-edit-trigger:hover {
    color: var(--signal);
}

.recipe-assumption {
    max-width: 72ch;
    margin: 1.4rem 0 0;
    color: #606b6d;
    font-family: var(--utility);
    font-size: 0.58rem;
    line-height: 1.6;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: #606b6d;
    font-family: var(--utility);
    font-size: 0.55rem;
}

/* Dialog */

.image-lightbox {
    --lightbox-accent: var(--signal);
    width: min(calc(100% - 2rem), 70rem);
    max-width: none;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--text);
}

.image-lightbox[data-slot="1"] { --lightbox-accent: #6ac6c7; }
.image-lightbox[data-slot="2"] { --lightbox-accent: #d8a25d; }
.image-lightbox[data-slot="3"] { --lightbox-accent: #9e91d6; }
.image-lightbox[data-slot="4"] { --lightbox-accent: #d47668; }
.image-lightbox[data-slot="5"] { --lightbox-accent: #7fb68f; }

.image-lightbox::backdrop {
    background: rgba(4, 6, 7, 0.62);
    -webkit-backdrop-filter: blur(18px) saturate(0.7);
    backdrop-filter: blur(18px) saturate(0.7);
}

.lightbox-surface {
    position: relative;
    display: grid;
    max-height: calc(100dvh - 2rem);
    grid-template-rows: auto minmax(0, 1fr);
    padding: clamp(0.7rem, 1.8vw, 1.2rem);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--lightbox-accent) 38%, var(--line));
    border-radius: 1rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--lightbox-accent) 8%, transparent), transparent 42%),
        rgba(15, 19, 21, 0.96);
    box-shadow: 0 2.5rem 7rem rgba(0, 0, 0, 0.62);
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 0.7rem 0.25rem;
}

.lightbox-header p,
.lightbox-figure figcaption {
    margin: 0;
    color: #aeb9b8;
    font-family: var(--utility);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lightbox-header span {
    color: var(--lightbox-accent);
}

.lightbox-close {
    display: grid;
    width: 2.65rem;
    aspect-ratio: 1;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(235, 244, 242, 0.18);
    border-radius: 50%;
    background: rgba(8, 11, 12, 0.7);
    color: var(--text);
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.lightbox-close:hover {
    border-color: var(--lightbox-accent);
    background: color-mix(in srgb, var(--lightbox-accent) 15%, #080b0c);
    transform: rotate(4deg);
}

.lightbox-close svg {
    width: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.6;
}

.lightbox-figure {
    display: grid;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin: 0;
}

.lightbox-stage {
    position: relative;
    display: grid;
    min-height: min(67vh, 42rem);
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(226, 238, 235, 0.12);
    border-radius: 0.72rem;
    background:
        radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--lightbox-accent) 10%, transparent), transparent 56%),
        #0c1012;
    box-shadow: inset 0 0 0 0.35rem rgba(0, 0, 0, 0.18);
}

.lightbox-stage::after {
    position: absolute;
    inset: 0;
    border: 0.7rem solid transparent;
    border-top-color: color-mix(in srgb, var(--lightbox-accent) 42%, transparent);
    border-left-color: color-mix(in srgb, var(--lightbox-accent) 42%, transparent);
    clip-path: polygon(0 0, 4rem 0, 4rem 1px, 1px 1px, 1px 4rem, 0 4rem);
    content: "";
    pointer-events: none;
}

.lightbox-stage img {
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - 9.5rem);
    padding: clamp(0.5rem, 2vw, 1.5rem);
    filter: drop-shadow(0 1.6rem 2.8rem rgba(0, 0, 0, 0.42));
    object-fit: contain;
}

.lightbox-figure figcaption {
    overflow: hidden;
    color: #dce3e1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-dialog,
.recipe-dialog {
    width: min(calc(100% - 2rem), 33rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(218, 231, 231, 0.18);
    border-radius: 1.25rem;
    background: #1c2124;
    box-shadow: var(--shadow);
    color: var(--text);
}

.edit-dialog::backdrop,
.recipe-dialog::backdrop {
    background: rgba(5, 7, 8, 0.76);
    backdrop-filter: blur(8px);
}

.dialog-surface {
    padding: clamp(1.3rem, 4vw, 2rem);
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.8rem;
}

.dialog-header h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 2.5rem;
    letter-spacing: -0.05em;
}

.dialog-close {
    text-decoration: none;
}

.edit-form {
    display: grid;
    gap: 1.15rem;
}

.edit-dialog {
    width: min(calc(100% - 2rem), 42rem);
    overflow: auto;
}

.fill-media-editor {
    display: grid;
    grid-template-columns: minmax(10rem, 0.82fr) 1.18fr;
    gap: 1rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: #181d20;
}

.fill-image-preview {
    position: relative;
    display: grid;
    min-height: 9.5rem;
    overflow: hidden;
    border: 1px dashed #3c4749;
    border-radius: 0.7rem;
    background:
        linear-gradient(135deg, rgba(113, 200, 199, 0.06), transparent 55%),
        #111517;
    place-items: center;
}

.fill-image-preview.has-image {
    border-style: solid;
    border-color: rgba(113, 200, 199, 0.28);
}

.fill-image-preview img {
    width: 100%;
    height: 100%;
    min-height: 9.5rem;
    object-fit: contain;
}

.fill-image-empty {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    padding: 1rem;
    color: #7b8788;
    text-align: center;
}

.fill-image-empty[hidden],
.fill-image-preview img[hidden] {
    display: none;
}

.fill-image-empty svg {
    width: 2rem;
    fill: none;
    stroke: var(--signal);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.fill-image-empty span {
    color: #c9d2d0;
    font-size: 0.72rem;
    font-weight: 680;
}

.fill-image-empty small {
    max-width: 15ch;
    color: #657173;
    font-size: 0.58rem;
    line-height: 1.4;
}

.fill-media-controls {
    display: grid;
    align-content: center;
    gap: 0.7rem;
}

.edit-form .file-picker {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    align-items: center;
    gap: 0.8rem;
    min-height: 4.2rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: #1d2326;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.edit-form .file-picker:hover {
    border-color: rgba(113, 200, 199, 0.48);
    background: #20282b;
}

.file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.file-picker:focus-within {
    border-color: rgba(113, 200, 199, 0.72);
    box-shadow: 0 0 0 3px rgba(113, 200, 199, 0.1);
}

.file-picker-icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--signal);
    color: #0f1517;
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 700;
    place-items: center;
}

.file-picker > span:last-child {
    display: grid;
    gap: 0.2rem;
}

.file-picker strong {
    color: #d8dfdd;
    font-size: 0.72rem;
}

.file-picker small {
    color: #687476;
    font-size: 0.56rem;
    line-height: 1.4;
}

.edit-form .remove-image-control {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 0.55rem;
    color: #899495;
    cursor: pointer;
    font-size: 0.65rem;
}

.edit-form .remove-image-control[hidden] {
    display: none;
}

.remove-image-control input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--danger);
}

.rating-editor {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.25rem 1rem;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: #181d20;
}

.rating-editor legend {
    padding: 0 0.35rem;
    color: var(--steel);
    font-family: var(--utility);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rating-control {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.rating-star,
.rating-reset {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.rating-star {
    padding: 0.12rem;
    color: #414a4b;
    font-size: 1.4rem;
    line-height: 1;
    transition: color 140ms ease, filter 140ms ease, transform 140ms ease;
}

.rating-star:hover,
.rating-star:focus-visible,
.rating-star.is-active {
    color: #e6b45d;
    filter: drop-shadow(0 0 7px rgba(230, 180, 93, 0.34));
}

.rating-star:hover,
.rating-star:focus-visible {
    transform: translateY(-1px) scale(1.08);
}

.rating-reset {
    margin-left: 0.5rem;
    padding: 0.3rem 0;
    color: #6e797a;
    font-family: var(--utility);
    font-size: 0.55rem;
    text-transform: uppercase;
}

.rating-editor output {
    color: #7f8a8b;
    font-size: 0.65rem;
}

.recipe-dialog {
    width: min(calc(100% - 2rem), 46rem);
    overflow: auto;
}

.recipe-form {
    display: grid;
    gap: 1.15rem;
}

.recipe-form label,
.recipe-amounts label,
.recipe-notes-field {
    display: grid;
    gap: 0.5rem;
}

.recipe-form label > span,
.recipe-amounts label > span,
.recipe-amounts legend {
    color: var(--steel);
    font-family: var(--utility);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recipe-form-copy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.recipe-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
}

.recipe-amounts legend {
    padding: 0 0.5rem;
    color: var(--signal);
}

.recipe-amounts input {
    height: 2.9rem;
}

.mix-readout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--line);
}

.mix-readout div {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    background: #181d20;
}

.mix-readout output {
    color: var(--text);
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 650;
}

.mix-readout.is-mismatched div:first-child output {
    color: var(--danger);
}

.form-hint {
    margin: 0;
    color: #6f7a7b;
    font-size: 0.72rem;
    line-height: 1.5;
}

.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

.clear-button {
    padding: 0.7rem 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.75rem;
}

.save-button {
    justify-content: center;
}

@media (max-width: 1100px) {
    .preference-add-form {
        grid-template-columns: 1fr 1fr;
    }

    .preference-url-field,
    .preference-add-button {
        grid-column: 1 / -1;
    }

    .preference-add-button {
        justify-content: center;
    }

    .recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fill-rack {
        grid-auto-columns: minmax(15rem, 28vw);
        grid-auto-flow: column;
        grid-template-columns: none;
        margin-right: calc(clamp(1rem, 4vw, 4rem) * -1);
        padding-right: clamp(1rem, 4vw, 4rem);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: 0;
        scroll-snap-type: inline mandatory;
        scrollbar-width: thin;
    }

    .fill-card {
        scroll-snap-align: start;
    }

    .rack-labels > span {
        display: inline;
    }

}

@media (max-width: 760px) {
    .login-shell {
        display: block;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        min-height: 100dvh;
        align-content: center;
        padding: 1.25rem;
        background:
            radial-gradient(circle at 50% 5%, rgba(113, 200, 199, 0.12), transparent 18rem),
            #111518;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        margin-bottom: 4rem;
    }

    .mobile-brand strong {
        font-size: 0.88rem;
    }

    .topbar {
        min-height: 4.4rem;
        padding: 0.7rem 1rem;
    }

    .brand small,
    .sync-status,
    .install-button {
        display: none;
    }

    .section-nav {
        position: static;
        margin-left: auto;
        transform: none;
    }

    .section-nav a {
        padding: 0.4rem 0.58rem;
        font-size: 0.53rem;
    }

    .dashboard {
        padding-top: 2.6rem;
    }

    .dashboard-heading {
        display: block;
        margin-bottom: 2.8rem;
    }

    .dashboard-heading h1 {
        font-size: clamp(3.1rem, 17vw, 5.3rem);
    }

    .heading-note {
        margin-top: 1.4rem;
    }

    .dashboard-notice {
        margin-top: -1.3rem;
    }

    .fill-rack {
        grid-auto-columns: minmax(16rem, 83vw);
        gap: 0.8rem;
    }

    .fill-card article {
        min-height: 34rem;
    }

    .tank-image {
        width: 13.5rem;
    }

    .collection-summary {
        display: block;
    }

    .collection-summary h2 {
        font-size: clamp(3rem, 16vw, 5rem);
    }

    .collection-toggle {
        width: 100%;
        justify-content: space-between;
        margin-top: 1.25rem;
        padding-top: 0.9rem;
        border-top: 1px solid var(--line);
    }

    .preference-add-form,
    .preference-groups,
    .preference-editor form {
        grid-template-columns: 1fr;
    }

    .preference-url-field,
    .preference-add-button,
    .preference-editor-actions {
        grid-column: auto;
    }

    .new-recipe-button {
        width: 100%;
        justify-content: center;
        margin-top: 1.5rem;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-card {
        min-height: 24rem;
    }

    .recipe-form-copy,
    .recipe-amounts {
        grid-template-columns: 1fr 1fr;
    }

    .mix-readout {
        grid-template-columns: 1fr;
    }

    .app-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .fill-media-editor {
        grid-template-columns: 1fr;
    }

    .fill-image-preview,
    .fill-image-preview img {
        min-height: 12rem;
    }

    .rating-editor {
        grid-template-columns: 1fr;
    }

    .rating-control {
        flex-wrap: wrap;
    }

    .clear-button {
        min-height: 2.75rem;
    }

    .image-lightbox {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .lightbox-surface {
        max-height: calc(100dvh - 1rem);
        padding: 0.6rem;
        border-radius: 0.8rem;
    }

    .lightbox-stage {
        min-height: min(64vh, 34rem);
    }

    .lightbox-stage img {
        max-height: calc(100dvh - 8.5rem);
        padding: 0.45rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .fill-card {
        animation: rack-in 500ms both;
    }

    .fill-card:nth-child(2) { animation-delay: 60ms; }
    .fill-card:nth-child(3) { animation-delay: 120ms; }
    .fill-card:nth-child(4) { animation-delay: 180ms; }
    .fill-card:nth-child(5) { animation-delay: 240ms; }

    .image-lightbox[open] .lightbox-surface {
        animation: lightbox-in 220ms cubic-bezier(.2,.8,.2,1) both;
    }

    @keyframes rack-in {
        from { opacity: 0; transform: translateY(18px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes lightbox-in {
        from { opacity: 0; transform: translateY(0.8rem) scale(0.985); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}
