/* Studio-Szenen — "Dunkelkammer": darkroom safelight, film contact sheets, grease-pencil approval marks.
   Fonts are self-hosted (no third-party requests): Gloock, Schibsted Grotesk, Azeret Mono, Reenie Beanie (all OFL). */

@font-face {
    font-family: 'Gloock';
    src: url('/fonts/gloock-400-normal.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Schibsted Grotesk';
    src: url('/fonts/schibsted-grotesk-400-normal.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Schibsted Grotesk';
    src: url('/fonts/schibsted-grotesk-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Azeret Mono';
    src: url('/fonts/azeret-mono-400-normal.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Azeret Mono';
    src: url('/fonts/azeret-mono-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Reenie Beanie';
    src: url('/fonts/reenie-beanie-400-normal.woff2') format('woff2');
    font-display: swap;
}

:root {
    /* darkroom */
    --ink: #140d0b;
    --ink-2: #1e1512;
    --ink-3: #2a1e1a;
    --line: #3b2a24;
    --paper: #f2e9dc;
    --paper-dim: #b9a898;
    --muted: #8f7d70;
    /* safelight + developer amber */
    --safe: #ff4b36;
    --safe-deep: #c22d1f;
    --amber: #f0a742;
    /* light table (viewer) */
    --table: #f7f1e6;
    --table-ink: #241915;

    --display: 'Gloock', 'Bodoni 72', Didot, serif;
    --text: 'Schibsted Grotesk', 'Avenir Next', sans-serif;
    --mono: 'Azeret Mono', ui-monospace, monospace;
    --hand: 'Reenie Beanie', 'Bradley Hand', cursive;

    --radius: 4px;
    --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--paper);
    font: 400 16px/1.5 var(--text);
    -webkit-tap-highlight-color: transparent;
    background:
        radial-gradient(120% 60% at 0% -10%, rgba(255, 75, 54, 0.22), transparent 60%),
        radial-gradient(90% 50% at 110% 110%, rgba(240, 167, 66, 0.08), transparent 60%),
        radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55)), var(--ink);
    background-attachment: fixed;
}

/* film grain */
body::before {
    content: '';
    position: fixed;
    inset: -50%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.09;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
    0% {
        transform: translate(0, 0);
    }
    20% {
        transform: translate(-3%, 2%);
    }
    40% {
        transform: translate(2%, -4%);
    }
    60% {
        transform: translate(-4%, -1%);
    }
    80% {
        transform: translate(3%, 3%);
    }
    100% {
        transform: translate(0, 0);
    }
}

[hidden] {
    display: none !important;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0;
}

.eyebrow {
    font: 600 0.68rem/1 var(--mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--safe);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.error {
    color: var(--safe);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- layout ---------- */

.screen {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.2rem 1rem calc(6rem + env(safe-area-inset-bottom));
    animation: develop-in 0.6s var(--ease) both;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 1.7rem;
    margin: 0.4rem 0 0.9rem;
}

.section-title span {
    font: 600 0.72rem var(--mono);
    color: var(--safe);
    letter-spacing: 0.1em;
    transform: translateY(-0.45rem);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: calc(0.8rem + env(safe-area-inset-top)) 1rem 0.75rem;
    background: linear-gradient(var(--ink) 70%, rgba(20, 13, 11, 0.85));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

.brand h1 {
    font-size: 1.55rem;
    line-height: 1;
    margin-top: 0.3rem;
}

.meter {
    display: grid;
    gap: 0.35rem;
    justify-items: end;
    font: 400 0.72rem var(--mono);
    color: var(--paper-dim);
}

.meter-bar {
    width: 7.5rem;
    height: 3px;
    background: var(--line);
    overflow: hidden;
}

#budget-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
    transition: width 0.8s var(--ease);
}

.meter.warn {
    color: var(--safe);
}

.meter.warn #budget-fill {
    background: var(--safe);
    box-shadow: 0 0 8px var(--safe);
}

/* ---------- form controls ---------- */

.card {
    position: relative;
    background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0 0 1rem;
}

label {
    display: block;
    font: 600 0.68rem/1 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--paper-dim);
    margin: 0.9rem 0 0.5rem;
}

label:first-child {
    margin-top: 0;
}

label.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font: 400 0.95rem var(--text);
    letter-spacing: 0;
    text-transform: none;
    color: var(--paper);
}

input[type='checkbox'] {
    accent-color: var(--safe);
    width: 1.1rem;
    height: 1.1rem;
}

input:not([type='checkbox']),
textarea,
select {
    width: 100%;
    font: inherit;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--safe);
    box-shadow: 0 0 0 3px rgba(255, 75, 54, 0.18);
}

::placeholder {
    color: #6f5e53;
}

button,
.button {
    min-width: 0;
    overflow-wrap: break-word;
    font: 600 0.95rem var(--text);
    color: var(--paper);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    transition:
        transform 0.15s var(--ease),
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s;
}

button:active {
    transform: scale(0.97);
}

button:focus-visible,
.button:focus-within {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

button.primary {
    background: var(--safe);
    border-color: var(--safe);
    color: var(--ink);
    box-shadow: 0 0 22px rgba(255, 75, 54, 0.35);
}

button.primary:hover {
    background: #ff6450;
}

button.big {
    width: 100%;
    padding: 1.05rem;
    font: 600 1.05rem var(--text);
    letter-spacing: 0.01em;
}

button:disabled {
    opacity: 0.35;
    box-shadow: none;
}

button.danger {
    color: var(--safe);
}

button.link {
    background: none;
    border: none;
    color: var(--muted);
    font: 400 0.8rem var(--mono);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.button {
    border-style: dashed;
    color: var(--paper-dim);
    font-size: 0.9rem;
}

/* ---------- password change ---------- */

.password-card summary {
    cursor: pointer;
    font-weight: 600;
}

.password-card form {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

/* ---------- login ---------- */

.login {
    min-height: 100vh;
    min-height: 100dvh;
    /* No tab bar here: symmetric padding so the card sits in the visual centre. */
    padding: calc(1.5rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
}

.login-card {
    width: 100%;
    max-width: 360px;
    display: grid;
    gap: 0.9rem;
    text-align: center;
}

.login-title {
    /* "Facettenreich" is ~6.75em wide in Gloock: keep it inside the card at every width. */
    font-size: clamp(2.2rem, 12.5vw, 3.3rem);
    margin-bottom: 0.6rem;
    line-height: 0.9;
    animation: develop-in 1.4s var(--ease) both;
}

.login-title em {
    font-style: normal;
    color: var(--safe);
    text-shadow: 0 0 28px rgba(255, 75, 54, 0.45);
}

/* ---------- scene tiles: numbered frames ---------- */

/* ---------- create flow ---------- */

.section-title b {
    font-weight: 400;
}

.paths,
.scene-list {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 1rem;
}

.path,
.scene-row {
    display: grid;
    grid-template-columns: 2.6rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.8rem;
    align-items: center;
    text-align: left;
    padding: 0.9rem 1rem;
    background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
    border: 1px solid var(--line);
    animation: develop-in 0.6s var(--ease) both;
}

.path:hover,
.scene-row:hover {
    border-color: var(--amber);
}

.path i,
.scene-row i {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius);
    font-style: normal;
    font-size: 1.3rem;
    color: var(--amber);
    background: rgba(240, 167, 66, 0.1);
    filter: saturate(0.6) sepia(0.25);
    transition: filter 0.3s;
}

.path:hover i,
.scene-row:hover i {
    filter: none;
}

/* Same type as the original scene tiles: text face, not the display serif. */
.path b,
.scene-row b {
    font: 600 0.95rem/1.25 var(--text);
    color: var(--paper);
}

.path span,
.scene-row small {
    font: 400 0.82rem/1.3 var(--text);
    color: var(--paper-dim);
}

.scene-row span {
    grid-row: 1 / 3;
    align-self: center;
    display: grid;
    gap: 0.15rem;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
}

.chip.active {
    color: var(--ink);
    background: var(--amber);
    border-color: var(--amber);
    border-style: solid;
}

.two-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 0.2rem 0 0.4rem;
}

details.more {
    margin-top: 0.9rem;
}

details.more summary {
    cursor: pointer;
    font: 400 0.8rem var(--mono);
    color: var(--muted);
}

.draft-text {
    display: grid;
    gap: 0.4rem;
}

.draft-text button.link {
    justify-self: start;
    padding: 0.2rem 0;
}

button.back {
    padding: 0.2rem 0;
    margin-bottom: 0.4rem;
}

.optional {
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: none;
    font-weight: 400;
}

.segmented.angles {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.segmented.angles button {
    font: 600 0.85rem var(--text);
    border-bottom: 1px solid rgba(36, 25, 21, 0.2);
}

.segmented.angles button:nth-child(2n) {
    border-right: none;
}

.segmented.angles button:nth-last-child(-n + 2) {
    border-bottom: none;
}

.mode {
    margin-bottom: 1rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.6rem 0 0.2rem;
}

.chip {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font: 400 0.78rem var(--text);
    color: var(--paper-dim);
    border-style: dashed;
}

.open-carousel {
    width: 100%;
}

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

.carousel-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.5rem;
    text-align: left;
    animation: develop-in 0.6s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

.carousel-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border-radius: 2px;
}

.carousel-card-title {
    font: 400 1.05rem/1.2 var(--display);
}

.carousel-editor .slides {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.4rem 0 1rem;
    margin: 0 -1rem;
    padding-inline: 1rem;
}

.slide-edit {
    flex: 0 0 82%;
    scroll-snap-align: center;
}

.slide-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border-radius: 2px;
    box-shadow: 0 10px 26px rgba(36, 25, 21, 0.25);
}

.slide-type {
    margin: 0 0 0.4rem;
    font: 600 0.65rem var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--safe-deep);
}

.carousel-title {
    margin: 0.2rem 0;
    font-size: 1.5rem;
}

.regen {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.qa-hint {
    color: #8a5a1c;
    font-size: 0.8rem;
}

.proof-controls {
    margin-top: 0.6rem;
    padding: 0.7rem;
    border: 1px dashed rgba(36, 25, 21, 0.3);
    border-radius: var(--radius);
}

.proof-controls .row {
    margin-top: 0.6rem;
}

/* ---------- segmented controls ---------- */

.segmented {
    display: flex;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.segmented button {
    flex: 1;
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--line);
    padding: 0.6rem 0.3rem;
    font: 400 0.85rem var(--mono);
    color: var(--paper-dim);
}

.segmented button:last-child {
    border-right: none;
}

.segmented button.active {
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
}

/* ---------- jobs: the developer tray ---------- */

.job {
    margin-top: 1rem;
    border-left: 3px solid var(--amber);
}

.job .status {
    margin: 0 0 0.7rem;
    font: 400 0.85rem/1.45 var(--mono);
    color: var(--paper-dim);
}

.job:not(.failed):has(.results:empty) .status::before {
    content: '';
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.55rem;
    border-radius: 50%;
    background: var(--safe);
    box-shadow: 0 0 10px var(--safe);
    animation: safelight 1.6s ease-in-out infinite;
}

@keyframes safelight {
    50% {
        opacity: 0.25;
        box-shadow: none;
    }
}

.plan {
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.75rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--paper);
}

.plan-summary {
    margin: 0;
}

.plan ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    color: var(--amber);
    font-size: 0.82rem;
}

.badge.warn {
    left: 0.3rem;
    right: auto;
    background: var(--amber);
    color: var(--ink);
}

.job.failed {
    border-left-color: var(--safe);
}

.job.failed .status {
    color: var(--safe);
}

/* ---------- contact sheet ---------- */

.stages {
    margin-bottom: 0.6rem;
}

#stage-hint {
    margin: 0 0 0.9rem;
}

.filmstrip {
    position: relative;
    padding: 2.1rem 0.55rem 1.9rem;
    border-radius: 2px;
    /* sprocket holes along both edges */
    background:
        repeating-linear-gradient(90deg, transparent 0 10px, rgba(242, 233, 220, 0.16) 10px 22px, transparent 22px 30px)
            0 5px / 100% 8px no-repeat,
        repeating-linear-gradient(90deg, transparent 0 10px, rgba(242, 233, 220, 0.16) 10px 22px, transparent 22px 30px)
            0 calc(100% - 5px) / 100% 8px no-repeat,
        #0b0706;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.filmstrip::after {
    content: 'FACETTENREICH 400  ▸  SAFETY FILM';
    position: absolute;
    right: 0.6rem;
    top: 1.05rem;
    font: 400 0.52rem var(--mono);
    letter-spacing: 0.2em;
    color: var(--amber);
    opacity: 0.6;
}

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

.contact {
    row-gap: 1.35rem;
}

.thumb {
    position: relative;
    padding: 0;
    overflow: visible;
    aspect-ratio: 3 / 4;
    border: none;
    border-radius: 1px;
    background: #000;
    counter-increment: frame;
    animation: develop 0.9s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.thumb img,
.thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 1px;
}

.contact .thumb::before {
    content: counter(frame, decimal-leading-zero);
    position: absolute;
    left: 0.15rem;
    bottom: -1.05rem;
    font: 400 0.55rem var(--mono);
    color: var(--amber);
    opacity: 0.8;
}

.badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    font: 600 0.62rem var(--mono);
    background: rgba(20, 13, 11, 0.8);
    color: var(--paper);
    border-radius: 2px;
    padding: 0.1rem 0.3rem;
}

/* grease-pencil approval: circled frame + handwritten "ok" */
.thumb.approved::after {
    content: '';
    position: absolute;
    inset: -7px -6px;
    border: 2.5px solid var(--safe);
    border-radius: 48% 52% 45% 55% / 52% 46% 54% 48%;
    transform: rotate(-3deg);
    pointer-events: none;
    animation: circle-in 0.5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 400ms);
}

.mark {
    position: absolute;
    z-index: 2;
    right: -0.1rem;
    top: -1.45rem;
    font: 400 2.2rem/1 var(--hand);
    color: var(--safe);
    transform: rotate(-8deg);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

@keyframes circle-in {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ---------- reference photos ---------- */

.thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.ref {
    position: relative;
    aspect-ratio: 1;
    animation: develop 0.8s var(--ease) both;
}

.ref img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    filter: grayscale(0.2) contrast(1.05);
}

.ref button {
    position: absolute;
    z-index: 1;
    top: 0.2rem;
    right: 0.2rem;
    padding: 0.05rem 0.4rem;
    font: 400 0.75rem var(--mono);
    background: rgba(20, 13, 11, 0.85);
}

.ref-service {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.15rem 0.3rem;
    font: 400 0.6rem var(--mono);
    color: var(--paper);
    background: rgba(20, 13, 11, 0.8);
    border-radius: 0 0 2px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Invisible native select over the thumbnail: a tap opens the treatment picker. */
.ref select.ref-picker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

#tab-photos .card h2 {
    font-size: 1.3rem;
}

/* ---------- tab bar ---------- */

.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    background: rgba(14, 9, 8, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar button {
    position: relative;
    flex: 1;
    border: none;
    border-radius: 0;
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    padding: 0.7rem 0 0.65rem;
    color: var(--muted);
}

.tabbar i {
    font-style: normal;
    font-size: 1.05rem;
}

.tabbar span {
    font: 400 0.62rem var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.tabbar button.active {
    color: var(--paper);
}

.tabbar button.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 30%;
    right: 30%;
    height: 2px;
    background: var(--safe);
    box-shadow: 0 0 12px var(--safe);
}

.tabbar button.active i {
    color: var(--safe);
}

/* ---------- viewer: the light table ---------- */

dialog {
    width: min(640px, 100vw);
    max-height: 100dvh;
    margin: auto;
    border: none;
    border-radius: 3px;
    padding: 1rem 1rem 0.6rem;
    color: var(--table-ink);
    background:
        linear-gradient(rgba(36, 25, 21, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, rgba(36, 25, 21, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
        radial-gradient(circle at 50% 30%, #fffdf8, var(--table));
    box-shadow: 0 0 80px rgba(255, 245, 225, 0.25);
}

dialog[open] {
    animation: table-on 0.45s var(--ease) both;
}

@keyframes table-on {
    from {
        opacity: 0;
        transform: translateY(14px);
        filter: brightness(0.4);
    }
}

dialog::backdrop {
    background: rgba(8, 5, 4, 0.82);
}

.viewer-stage {
    display: inline-block;
    margin: 0 0 0.7rem;
    font: 600 0.65rem var(--mono);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--safe-deep);
    border: 1px solid currentColor;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

.viewer-media img,
.viewer-media video {
    width: 100%;
    max-height: 58vh;
    object-fit: contain;
    background: #0b0706;
    border-radius: 2px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8),
        0 12px 30px rgba(36, 25, 21, 0.25);
}

.viewer-note {
    white-space: pre-line;
    margin: 0.6rem 0 0;
    color: #6d5a4f;
    font-family: var(--mono);
    font-size: 0.78rem;
}

.viewer-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0.8rem 0;
}

dialog button {
    color: var(--table-ink);
    border-color: rgba(36, 25, 21, 0.2);
    background: rgba(255, 255, 255, 0.55);
}

.viewer-actions button {
    padding: 0.7rem 0.3rem;
}

dialog button.primary {
    background: var(--table-ink);
    border-color: var(--table-ink);
    color: var(--paper);
    box-shadow: none;
}

dialog button.danger {
    color: var(--safe-deep);
}

dialog .card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(36, 25, 21, 0.15);
    color: var(--table-ink);
    animation: develop-in 0.35s var(--ease) both;
}

dialog label {
    color: #6d5a4f;
}

dialog label.check {
    color: var(--table-ink);
}

dialog input:not([type='checkbox']),
dialog textarea {
    background: #fffdf8;
    color: var(--table-ink);
    border-color: rgba(36, 25, 21, 0.2);
}

dialog ::placeholder {
    color: #a8978a;
}

dialog .segmented {
    border-color: rgba(36, 25, 21, 0.2);
}

dialog .segmented button {
    color: #6d5a4f;
    background: transparent;
    border-color: rgba(36, 25, 21, 0.2);
}

dialog .segmented button.active {
    background: var(--table-ink);
    color: var(--paper);
}

dialog .muted,
.hint {
    color: #7d6a5e;
}

.hint {
    font: 400 0.75rem/1.4 var(--mono);
    margin: 0.4rem 0;
}

dialog .error {
    color: var(--safe-deep);
}

dialog button.link {
    color: #7d6a5e;
}

/* ---------- motion ---------- */

@keyframes develop-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* prints coming up in the developer: dark and warm, then clear */
@keyframes develop {
    from {
        opacity: 0;
        filter: brightness(0.15) sepia(1) saturate(2) hue-rotate(-20deg) blur(2px);
    }
    60% {
        opacity: 1;
        filter: brightness(0.7) sepia(0.6) blur(0.5px);
    }
    to {
        opacity: 1;
        filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }
}
