/* ============================================================
   COMMON STYLES — Shared across Diffasaurus, Analysaurus & Notosaurus
   ============================================================ */

/* Base Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fix double scrollbar */
html {
    overflow-y: scroll;
    overflow-x: hidden;   /* on html, not body: with html's overflow set, a clip on body would make body a scroll box of its own, which never scrolls, so sticky things (the trial sticker) would never stick */
}

body {
    font-family: var(--font-body);
}

/* Reduced motion: when someone asks their device for less movement, changes happen
   instantly. The loading spinner keeps turning, since it shows that work is happening. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .status-analyzing {
        animation: none !important;
    }
}

/* ============================================================
   GLOBAL SCROLLBAR STYLING
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--ink7-a30);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink7-a50);
}

/* ============================================================
   CODEMIRROR STYLING
   ============================================================ */

.CodeMirror {
    height: 350px !important;
    color: var(--ink-text);
    border-radius: 0.5rem;
    font-size: 14px;
    font-family: var(--font-mono);
    border: none;
    background: var(--paper-cream) !important;
    background-color: var(--paper-cream) !important;
}

.CodeMirror-gutters {
    background: var(--paper-cream) !important;
    background-color: var(--paper-cream) !important;
    border-right: none !important;
}

.CodeMirror-linenumber {
    color: var(--ink-a70);
}

.CodeMirror-scroll {
    background: var(--paper-cream) !important;
    background-color: var(--paper-cream) !important;
}

.CodeMirror-sizer {
    background: var(--paper-cream) !important;
    background-color: var(--paper-cream) !important;
}

/* Syntax colors: the editor's standard default theme, with no custom colors for now */

/* ============================================================
   CODEMIRROR CURSOR & SELECTION
   ============================================================ */

.CodeMirror-cursor {
    border-left-color: var(--ink-900) !important;
}

/* Selection: the standard light-blue editor selection */
.CodeMirror-selected,
.CodeMirror-focused .CodeMirror-selected {
    background: var(--code-selection) !important;
}

.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
    background: var(--code-selection);
}

/* CodeMirror scrollbar styling */
.CodeMirror-vscrollbar::-webkit-scrollbar,
.CodeMirror-hscrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-track,
.CodeMirror-hscrollbar::-webkit-scrollbar-track {
    background: rgba(253, 246, 230, 0.5);
    border-radius: 4px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
    background: var(--ink7-a30);
    border-radius: 4px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--ink7-a50);
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */

.error {
    display: none;
}

/* ============================================================
   FOLDER TABS — Standardized Overlapping Row
   Tabs overlap like physical folder tabs: the active (left)
   tab sits on top, each inactive tab tucks behind its left
   neighbor. Overlap is relative (negative margin), so renaming
   a tool never reopens a gap. z-index requires position, hence
   position: relative on each tab.
   ============================================================ */

.folder-tabs {
    position: absolute;
    top: 0;
    left: 1rem;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    /* Sit the row on top of the folder body with a small overlap */
    transform: translateY(calc(-100% + 0.5rem));
}

.folder-tabs .folder-tab-active,
.folder-tabs .folder-tab-inactive {
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    /* Normal typewriter spacing instead of Tailwind's squeezed tracking */
    letter-spacing: var(--tracking-display);
}

/* The tabs keep one order on every page (Diffasaurus, Analysaurus, Notosaurus, Lookasaurus), so each dino
   always lives in the same spot. Each tab tucks behind its left neighbor, and the current tab
   always lies on top, wherever it sits. */
.folder-tabs .folder-tab-active {
    z-index: 3;
}

.folder-tabs .folder-tab-inactive {
    z-index: 2;
}

.folder-tabs > * + * {
    margin-left: -0.75rem;
}

/* The second of two neighboring inactive tabs tucks behind the first */
.folder-tabs .folder-tab-inactive + .folder-tab-inactive {
    z-index: 1;
}

/* And the third in a row tucks behind the second */
.folder-tabs .folder-tab-inactive + .folder-tab-inactive + .folder-tab-inactive {
    z-index: 0;
}

/* Desktop: all four tabs are the same width, like real folder tabs, so nothing slides when you
   change page. The current tab stands taller than the others, like the raised dino in the
   phone menu. */
@media (min-width: 1025px) {
    .folder-tabs .folder-tab-active,
    .folder-tabs .folder-tab-inactive {
        min-width: 16.5rem;
        justify-content: center;
    }

    .folder-tabs .folder-tab-inactive {
        height: 2.75rem;
    }
}

/* A narrow desktop window is not wide enough for four full tabs: the ones behind give up a
   little width so the row still ends inside the folder */
@media (min-width: 1025px) and (max-width: 1099px) {
    .folder-tabs .folder-tab-inactive {
        min-width: 14.5rem;
    }
}

/* Section labels and panels inside the folder: readable words, as wide as the label,
   and a quieter line than the folder's outer edge. The bottom 0.5rem of a label tucks
   behind its panel. Like the big tool tabs, the words are centered on the whole label,
   tucked part included, which sets them a little low and gives the high-riding typewriter
   letters room above. Sizes are in em so every label keeps the big tool tabs' proportions:
   about two letter heights of visible tab and a little more than one letter on each side. */
.sub-folder-tab {
    width: auto !important;
    height: calc(2em + 0.5rem) !important;
    top: -2em !important;
    padding: 0 1.25em !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap;
    border-color: var(--ink-a20) !important;
}

.sub-folder-panel {
    border-color: var(--ink-a20) !important;
}

/* Paper folders: one lamp light across the whole folder and a faint paper grain.
   Sections inside are divider sheets with their label tab: flat color, so the light never
   restarts, lying on the folder with a faint sheet shadow. */
.folder-body {
    background-color: var(--folder-amber) !important;
    background-image:
        var(--paper-grain),
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(255, 250, 235, 0.55), rgba(255, 250, 235, 0) 70%),
        linear-gradient(var(--lamp-angle), var(--folder-amber) 0%, var(--folder-mid-bare) 55%, var(--folder-edge-bare) 100%) !important;
}

.sub-folder-panel,
.sub-folder-tab {
    background-color: var(--sheet) !important;
    background-image: var(--paper-grain) !important;
    box-shadow: var(--shadow-sheet) !important;
}

/* The folder stack: the front folder rests on its back sheet, and the whole stack lies on the desk */
.folder-body {
    box-shadow: var(--shadow-folder) !important;
}

.folder-back {
    box-shadow: var(--shadow-desk);
}

/* An open provider menu floats just above the paper */
#provider-menu {
    box-shadow: var(--shadow-paper-lift);
}

/* Cozy, not compact: on a full-size desk the panels give their writing wells more room to
   breathe. Doubled class so Tailwind's own padding, injected later, doesn't win. */
@media (min-width: 1025px) {
    .sub-folder-panel.sub-folder-panel {
        padding: 1.5rem;
    }
}

/* The desk footer: one quiet line of words on the wood below the folder. Words only, no logo —
   the business card carries the jelly and the address. Cream on dark wood, the body font at the
   small size, with room at the bottom for the phone nav. */
/* The business card's email address: plain words that copy themselves when pressed, dressed as
   the words around them, so nothing on the card opens a mail app (copy-buttons.js) */
.copy-address {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* The desk footer follows the Home page's footer's two lines (the names, then Contact, Privacy
   and Terms), without the jelly logo between them, in the desk's own cream */
.desk-footer {
    position: relative;
    z-index: 5;
    margin-top: 1.5rem;   /* the same gap Settings leaves above its footer */
    padding-bottom: 1.5rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    /* Paper, at full strength. This footer lies on the wooden desk, not on the dark leaves,
       so it takes the lightest paper rather than the glowing white the jungle pages wear */
    color: var(--paper-cream);
}

.desk-footer a {
    color: inherit;
    text-decoration: none;
}

.desk-footer a:hover {
    color: #fff;   /* a shade brighter than the paper the line rests in */
    text-decoration: underline;
    text-underline-offset: 2px;
}

.desk-footer .desk-footer-dot {
    padding: 0 0.4rem;
    opacity: 0.6;
}

/* The social icons: one centered row of small green icons at the very bottom of the desk
   footer, under its two lines of words. Each turns white under the mouse. */
.desk-footer .social-icons {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 0.5rem;
    color: #10b981;
}

.desk-footer .social-icons a {
    display: inline-flex;
    color: inherit;
    transition: color 0.15s ease;
}

.desk-footer .social-icons a:hover {
    color: #fff;
}

.desk-footer .social-icons svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .desk-footer {
        padding-bottom: 5.5rem;   /* clear of the phone nav */
    }
}

/* An open provider menu is lifted off the paper, so its row rises above everything near it */
.controls-bar:has(#provider-menu:not(.hidden)) {
    z-index: 50;
}

/* Card stock edges: the top and left edges catch the lamp, the bottom and right sit in shade, drawn on a layer
   that never takes clicks, so the folder's own shadow stays as it is. The same layer carries the
   lamp's falloff over everything on the folder, so it lies above the folder's contents. */
.folder-body::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 15;
    border-radius: inherit;
    background: var(--lamp-falloff);
    box-shadow: var(--edge-lit);
    pointer-events: none;
}

/* ============================================================
   STICKY NAVIGATION TABS
   ============================================================ */

/* On the folder's right edge, like the index tabs of real dividers, beside the key menu: home,
   settings and log out, the controls about you and your keys. They come out from between the
   folder and its back sheet, and cast the lamp's shadow onto the desk. */
.sticky-tabs {
    position: absolute;
    right: -40px;   /* 8px of each tab lies over the back sheet's strip; 32px stands clear */
    top: 60px;
    z-index: 10;
    width: 50px;   /* a tab's width when it is pulled out, held open. Without it the strip is only
                      as wide as a resting tab, so hovering one widens the strip and shoves every
                      tab sideways; the Home page escapes this because its current tab stands out */
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* The page tabs stand up to 42px outside the folder's right edge (the current or hovered tab),
   so on desktop the page always keeps 3.5rem of room on each side, however narrow the window.
   Both sides match, so the folder stays centered. Phones move the tabs into a row on top. */
@media (min-width: 769px) {
    div.page-container {
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }
}

.sticky-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding-left: 8px;   /* the icon sits centered in the part you can see, clear of the folder */
    height: 40px;   /* the phone tab turned on its side: 40 by 32 showing */
    text-decoration: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;   /* the button corner: page tabs are pressed like buttons */
    transition: width var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
    box-shadow: 1.5px 3px 6px rgba(0, 0, 0, 0.35);
}

.sticky-tab:hover {
    width: 50px;   /* pulled out 10px: the current page, or the tab under the pointer */
    opacity: 1;
    box-shadow: 2.5px 4px 10px rgba(0, 0, 0, 0.45);
}

.sticky-tab-glyph {
    font-size: 18px;
    line-height: 1;
    color: var(--on-green);
}

/* The current page's tab is cream like the active folder tab, sits slightly out, and is not a link */
.sticky-tab-current {
    width: 50px;   /* pulled out 10px: the current page, or the tab under the pointer */
    opacity: 1;
    background: linear-gradient(var(--tab-shade), var(--tab-shade)), var(--green);
    border: 1px solid rgba(253, 246, 230, 0.15);
    border-left: none;
    cursor: default;
}

.sticky-tab-current:hover {
    box-shadow: 1.5px 3px 6px rgba(0, 0, 0, 0.35);
}

/* The current tab is the same green as the others; only how far it stands out marks the page */

/* Green tab - DDA Home */
/* The one green, in the lamp's shade: the tabs stand at the folder's far edge, so they take the
   same few percent of falloff as a green button lying in that corner of the folder, and only a
   faint hairline edge, so they read as the same green as the buttons */
.sticky-tab-green {
    background: linear-gradient(var(--tab-shade), var(--tab-shade)), var(--green);
    border: 1px solid rgba(253, 246, 230, 0.15);
    border-left: none;
}

.sticky-tab-green:hover {
    background: linear-gradient(var(--tab-shade), var(--tab-shade)), var(--green);
}

/* ============================================================
   BUSINESS CARD PEEK-A-BOO
   ============================================================ */

.business-card-peekaboo {
    position: absolute;
    bottom: -30px;   /* the same overhang below the folder as beside it */
    right: -30px;
    z-index: 15;
    width: 440px;
    height: 320px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    cursor: pointer;
}

/* Where the folder reaches the sides of the screen there is no desk left for the card to lie
   on, and its corner hung off the page. It keeps the overhang below the folder, where there is
   still room, and tucks its right edge back to the folder's. */
@media (max-width: 768px) {
    .business-card-peekaboo {
        right: 0;
    }

    /* The card hangs below the folder, where on a narrow screen the footer's first line used to
       run underneath it. The footer steps down far enough to read clear of the card. */
    .desk-footer {
        margin-top: 3.5rem;
    }
}

.business-card-peekaboo > div {
    transform: rotate(4deg);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease;
}

.business-card-peekaboo:hover > div {
    transform: rotate(-1deg) translateY(-100px) translateX(-40px);
}

.business-card-peekaboo:hover {
    z-index: 35;
}

.business-card-peekaboo:hover > div > div:last-child {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04),
                0 8px 30px rgba(0,0,0,0.25),
                0 12px 40px rgba(0,0,0,0.15);
}

/* ============================================================
   PROVIDER DROPDOWN
   ============================================================ */

/* The key menu: who pays for the call. Aurelia, Anthropic, in the Settings sheets' order.
   A choice that cannot be used is grayed and does nothing; a small key marks a company whose key
   is saved on this device; the last line opens Settings in a new tab, so work on the page stays. */
button.provider-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.25;
    text-align: left;
    color: var(--ink-text);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-standard);
}

button.provider-option:hover {
    background: var(--ink-a10);
}

/* The current pick reads a step bolder */
button.provider-option[aria-checked="true"] {
    font-weight: 600;
}

button.provider-option.is-off,
button.provider-option.is-off:hover {
    color: var(--ink-a40);
    background: transparent;
    cursor: not-allowed;
}

.material-symbols-outlined.provider-key {
    font-size: 18px;
    color: var(--ink-a70);
}

.material-symbols-outlined.provider-key[hidden] {
    display: none;
}

.provider-settings-link {
    display: block;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;   /* the same size as the choices above it */
    line-height: 1.25;
    color: var(--ink-a70);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-standard),
                background-color var(--dur-fast) var(--ease-standard);
}

.provider-settings-link:hover {
    color: var(--ink-text);
    background: var(--ink-a10);
}

.provider-settings-link[hidden],
#provider-dropdown[hidden] {
    display: none;
}

/* Bring your own key is coming: a small quiet "Soon" beside each own-key choice */
.provider-soon {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-a60);
}

.provider-soon[hidden] {
    display: none;
}

/* ============================================================
   CONTROLS BAR — Save, Upload, Provider dropdown
   ============================================================ */

.controls-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ============================================================
   DROP ZONE — the well you drop files into (Analysaurus, Diffasaurus)
   A writing surface of solid paper cream, pressed into the sheet (flat, like the writing
   boxes), with a soft dashed edge. Its sentences are readable body text. With a mouse, the
   arrow lifts as you reach for the zone; while files are dragged over it, the edge turns solid
   green, the paper takes a faint green wash, and the arrow bobs to invite the drop.
   ============================================================ */
.drop-zone {
    padding: 2rem;
    text-align: center;
    background: var(--paper-cream);
    border: 1.5px dashed var(--ink-a30);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease-standard),
                background-color var(--dur-base) var(--ease-standard);
}

.drop-zone:hover {
    border-color: var(--ink-a50);
}

/* On a phone the well keeps its words but gives the width back to them; the buttons do the
   picking there, since there is nothing to drag */
@media (max-width: 768px) {
    .drop-zone {
        padding: var(--space-6) var(--space-4);
    }

    .material-symbols-outlined.drop-zone-icon {
        font-size: 32px;
    }

    /* On a phone, pasting is the quick way in: the paste boxes come first, then
       "or", then the smaller upload sheet, then Compare. A computer keeps the page's own order. */
    .input-choice {
        display: flex;
        flex-direction: column;
    }

    .input-choice > .input-paste        { order: 1; }
    .input-choice > #or-divider         { order: 2; }

    .input-choice > .input-upload {
        order: 3;
        margin-top: var(--space-4);
    }

    .input-choice > .input-paste-action { order: 4; }   /* Compare sits under both ways in, as on a computer */
}

.drop-zone.drag-over {
    border-style: solid;
    border-color: var(--green);
    background: color-mix(in srgb, var(--green) 6%, var(--paper-cream));
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.material-symbols-outlined.drop-zone-icon {
    display: block;
    font-size: 44px;
    color: var(--ink-a60);
    transition: transform var(--dur-base) var(--ease-standard),
                color var(--dur-base) var(--ease-standard);
}

/* The two ways to pick files sit side by side, a little apart from the words above */
.drop-zone-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

/* A button is a slip that stands out from the paper under it: on the cream well it is the
   manila sheet color, the reverse of a cream button lying on a sheet */
.drop-zone button.btn-cream {
    background: var(--sheet);
}

.drop-zone button.btn-cream:hover {
    background: linear-gradient(var(--ink-a10), var(--ink-a10)), var(--sheet);
}

.drop-zone.drag-over .drop-zone-icon {
    color: var(--green);
}

.drop-zone-text {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 15px;
    color: var(--ink-text);
}

.drop-zone-subtext {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink-a70);
}

@keyframes drop-bob {
    0%, 100% { transform: translateY(-3px); }
    50%      { transform: translateY(-8px); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .drop-zone:hover .drop-zone-icon {
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .drop-zone.drag-over .drop-zone-icon {
        animation: drop-bob 0.9s var(--ease-standard) infinite;
    }
}

/* ============================================================
   BUTTONS — two kinds, three sizes, one shape
   Green is the main action: it lies on the paper and casts the lamp shadow.
   Cream is thin paper: solid paper cream with a faint sheet shadow.
   Both kinds share every size, so a green and a cream button side by side
   always match. Default size suits toolbars and dialogs; btn-lg is the one
   main action under a box; btn-sm is a small tool inside a box (icon + word).
   Scoped to the element so Tailwind's button reset can't clear the fill.
   No display is set here, so Tailwind's "hidden" still hides a button.
   ============================================================ */

button.btn-cream,
label.btn-cream,
button.btn-green,
a.btn-green {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.25;
    padding: 0.5rem 1rem;
    min-height: 2.25rem;   /* one row height, shared with the toggles */
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
}

label.btn-cream {
    display: inline-flex;
    align-items: center;
}

button.btn-cream,
label.btn-cream {
    background: var(--paper-cream);
    color: var(--ink-text);
    border: 1px solid rgba(69, 26, 3, 0.25);
    box-shadow: var(--shadow-sheet);
    transition: background-color var(--dur-fast) var(--ease-standard),
                border-color var(--dur-fast) var(--ease-standard),
                transform var(--dur-base) var(--ease-standard);
}

button.btn-cream:hover,
label.btn-cream:hover {
    background: linear-gradient(var(--ink-a10), var(--ink-a10)), var(--paper-cream);
    border-color: var(--ink-a40);
}

/* The provider menu is the same paper as the buttons: solid cream, thin ink edge, same corner */
div#provider-menu {
    background: var(--paper-cream);
    border-color: rgba(69, 26, 3, 0.25);
    border-radius: var(--radius-md);
    /* As wide as its longest line, never narrower than the button, opening from the right edge
       so it stays on the folder wherever the button sits */
    left: auto;
    right: 0;
    width: max-content;
    min-width: 100%;
}

button.btn-cream:disabled,
button.btn-cream:disabled:hover {
    background: var(--cream-fill-off);
    color: rgba(69, 26, 3, 0.35);
    border-color: rgba(69, 26, 3, 0.15);
    box-shadow: none;
    cursor: not-allowed;
}

button.btn-green,
a.btn-green {
    background: var(--green);
    color: var(--on-green);
    border: 1px solid var(--green);
    box-shadow: var(--shadow-sheet-dark);
    transition: transform var(--dur-base) var(--ease-standard),
                box-shadow var(--dur-base) var(--ease-standard);
}

/* Lying flat on the paper like everything else. Hover lifts it into the raised shadow, so it
   still reads with motion off; a click stamps it flat. */
button.btn-green:not(:disabled):hover,
a.btn-green:hover {
    box-shadow: var(--shadow-paper-lift);
}

button.btn-green:not(:disabled):active,
a.btn-green:active {
    box-shadow: none;
}

button.btn-green:disabled {
    opacity: 0.5;
    box-shadow: none;
    cursor: not-allowed;
}

button.btn-sm,
label.btn-sm {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
    min-height: 2rem;   /* status stickers share this height, so a row of small pieces lines up */
}

button.btn-lg,
a.btn-lg {
    font-size: 15px;
    padding: 0.75rem 1.75rem;
}

/* Material Symbols icons inside buttons, labels and status lines, sized and aligned to the text */
.material-symbols-outlined.btn-icon {
    font-size: 1.15em;
    line-height: 1;
    vertical-align: -0.2em;
    margin-right: 0.3em;
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   Hidden on desktop, shown on mobile
   ============================================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* The same paper as the folder tabs: divider-sheet cream with the grain, the tabs' thin ink
       line, a top edge that catches the lamp, and a soft warm shadow, since it floats over the page */
    background: var(--paper-grain), var(--sheet);
    border-top: 1px solid var(--ink-a20);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 -2px 8px rgba(69, 26, 3, 0.18);
    padding: 4px 0;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    padding: 4px 2px;   /* five items share a phone's width */
    border-radius: 8px;
    transition: background var(--dur-base) var(--ease-standard);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    color: var(--ink-a70);
    transition: color var(--dur-base) var(--ease-standard);
}

.mobile-nav-item span {
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    color: var(--ink-a70);
    transition: color var(--dur-base) var(--ease-standard);
    white-space: nowrap;
}

/* A tool whose dino is not drawn yet shows a symbol in the dino's place, in the dino's box */
.mobile-nav-item .mobile-nav-symbol {
    font-family: 'Material Symbols Outlined';
    font-size: 28px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-item:active {
    background: var(--ink-a10);
}

.mobile-nav-item.active svg,
.mobile-nav-item.active span {
    color: var(--ink-text);
}

/* The current page is marked by its dino turning into the sticker version (and a darker
   label), so it is shown by shape, not color. With a mouse, hovering does the same, and the
   sticker sticks on with the status stickers' pop. */
.mobile-nav-item .nav-sticker {
    display: none;
}

/* The notepad dino has no drawn sticker file, so his sticker is cut in CSS: the same drawing
   with a white border laid around its shape, the width the drawn stickers use at this size */
.mobile-nav-item .nav-sticker-cut {
    filter: drop-shadow(1.5px 0 0 #fafafa) drop-shadow(-1.5px 0 0 #fafafa)
            drop-shadow(0 1.5px 0 #fafafa) drop-shadow(0 -1.5px 0 #fafafa);
}

.mobile-nav-item.active .mobile-nav-dino:not(.nav-sticker) {
    display: none;
}

.mobile-nav-item.active .nav-sticker {
    display: block;
}

@media (hover: hover) {
    .mobile-nav-item:hover .mobile-nav-dino:not(.nav-sticker) {
        display: none;
    }

    .mobile-nav-item:hover .nav-sticker {
        display: block;
    }
}

/* Every nav dino fidgets on hover: the current page's sticker wiggles, and any other dino
   turns into its sticker, pops on, then wiggles */
.mobile-nav-item .nav-sticker {
    transform-origin: 50% 90%;
}

/* The notepad dino has no drawn sticker file, so his sticker is cut in CSS: the same drawing
   with a white border laid around its shape, the width the drawn stickers use at this size */
.mobile-nav-item .nav-sticker-cut {
    filter: drop-shadow(1.5px 0 0 #fafafa) drop-shadow(-1.5px 0 0 #fafafa)
            drop-shadow(0 1.5px 0 #fafafa) drop-shadow(0 -1.5px 0 #fafafa);
}

@keyframes nav-wiggle {
    0%   { transform: rotate(0deg); }
    30%  { transform: translateY(-2px) rotate(-8deg); }
    60%  { transform: translateY(-2px) rotate(6deg); }
    85%  { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .mobile-nav-item.active:hover .nav-sticker {
        animation: nav-wiggle 0.5s var(--ease-standard);
    }

    .mobile-nav-item:not(.active):hover .nav-sticker {
        animation: sticker-stick 0.35s var(--ease-standard), nav-wiggle 0.5s var(--ease-standard) 0.35s;
    }
}

/* Dino images in mobile nav */
.mobile-nav-dino {
    width: 36px;
    height: 36px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity var(--dur-base) var(--ease-standard);
}

.mobile-nav-item.active .mobile-nav-dino {
    opacity: 1;
}

/* ============================================================
   DINO ASSET TOGGLE — Desktop vs Mobile
   Desktop versions shown by default, mobile versions hidden.
   At 768px breakpoint, swap visibility.
   ============================================================ */
.dino-mobile {
    display: none !important;
}

/* Sticker dinos (the outline artwork) are printed paper stuck flat on the folder, the thinnest
   thing on the desk, so they cast the same faint sheet shadow as the divider sheets around them,
   down and to the right from the lamp. Plain dinos stay flat. */
img[src$="_outline.svg"] {
    filter: drop-shadow(var(--shadow-sheet));
}

/* Sticker hover: with a mouse, the header sticker lifts a little off the paper, gives one small
   happy wiggle, and settles at its own crooked angle. Its shadow falls farther and softer while
   it is lifted. Each page sets --sticker-tilt. No motion on touch screens or with reduced motion. */
.header-logo {
    transition: transform var(--dur-base) var(--ease-standard),
                filter var(--dur-base) var(--ease-standard);
}

@media (hover: hover) {
    /* The page-open motion stays first in the list, so hovering never replays it */
    .header-logo:hover {
        transform: translateY(-3px) rotate(var(--sticker-tilt, 0deg));
        filter: drop-shadow(var(--shadow-paper-lift));
        animation: sticker-press 0.5s var(--ease-standard) 0.05s backwards,
                   sticker-wiggle 0.5s var(--ease-standard);
    }
}

@keyframes sticker-wiggle {
    0%   { transform: translateY(0) rotate(var(--sticker-tilt, 0deg)); }
    35%  { transform: translateY(-3px) rotate(calc(var(--sticker-tilt, 0deg) - 2deg)); }
    70%  { transform: translateY(-3px) rotate(calc(var(--sticker-tilt, 0deg) + 1.5deg)); }
    100% { transform: translateY(-3px) rotate(var(--sticker-tilt, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
    .header-logo:hover {
        animation: none;
        transform: rotate(var(--sticker-tilt, 0deg));
    }
}

/* ============================================================
   DESK MOTION — scrapbook, stationery and file folders
   Everything on the desk moves the way its paper version would. Motion runs only with a
   mouse and never with reduced motion; the hover changes that are not motion (the raised
   shadow on green, the ink shade on cream) stay either way.
   - Green main actions are rubber stamps: they rise as you reach for them and stamp down.
   - Cream tools are paper slips: a corner lifts with a slight tilt; a click presses them flat.
   - A toggle is one cream sticker: a newly chosen side sticks on with the status stickers' pop.
   - Status stickers are stickers: they wiggle like the dinos and pop on when a step reports.
   - Section tabs are folder tabs: they lift to peek. (The tool tabs already do.)
   - Copied: the check mark stamps in.
   ============================================================ */

.sub-folder-tab,
.status-sticker {
    transition: transform var(--dur-base) var(--ease-standard);
}

/* Labels and stickers are paper, not text to select or controls to press: the plain arrow,
   and no highlight when the mouse passes over them */
.sub-folder-tab,
.status-sticker,
.folder-tabs .folder-tab-active {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

@keyframes sticker-stick {
    0%   { transform: scale(0.9) rotate(-3deg); }
    60%  { transform: scale(1.06) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes stamp-in {
    0%   { transform: scale(1.6); opacity: 0; }
    60%  { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1); }
}

/* How each thing lands on the desk when the page opens. Nothing fades in: every piece is paper,
   put down by hand, and each kind lands its own way. These use scale, rotate and translate rather
   than transform, so a piece's own crooked angle, its hover lift and its press still work on top.
   - The dino sticker is pressed on: held a touch big above the paper in the lifted shadow, then
     pressed flat. It lets go of the shadow when it is done (backwards, not both), so the hover
     lift can still change it.
   - Status stickers are slapped on crooked (sticker-stick); the toggle leans the other way.
   - Cream buttons are paper slips laid down, sliding in a little from the lamp's side.
   - Green buttons are rubber stamps: they come down, squash a hair and settle.
   - The small remove pin is pushed in like a thumbtack. */
@keyframes sticker-press {
    0%   { scale: 1.12; translate: -2px -4px; filter: drop-shadow(var(--shadow-paper-lift)); }
    55%  { scale: 0.97; translate: 0 0;       filter: drop-shadow(var(--shadow-sheet)); }
    100% { scale: 1;    translate: 0 0;       filter: drop-shadow(var(--shadow-sheet)); }
}

@keyframes sticker-slap-right {
    0%   { scale: 0.9;  rotate: 3deg; }
    60%  { scale: 1.06; rotate: -1deg; }
    100% { scale: 1;    rotate: 0deg; }
}

@keyframes paper-lay {
    0%   { translate: -6px -4px; rotate: -2deg; }
    100% { translate: 0 0;       rotate: 0deg; }
}

@keyframes button-stamp {
    0%   { scale: 1.1;       translate: 0 -3px; }
    50%  { scale: 1.03 0.93; translate: 0 0; }
    75%  { scale: 0.99 1.02; }
    100% { scale: 1;         translate: 0 0; }
}

@keyframes pin-push {
    0%   { scale: 0.4; }
    50%  { scale: 1.2; }
    75%  { scale: 0.95; }
    100% { scale: 1; }
}

@media (prefers-reduced-motion: no-preference) {
    /* Page open: the desk lays itself out in order. The dino is pressed on, the status stickers
       and the toggle are slapped on, the cream slips are laid down, the green stamps come down,
       and Notosaurus's arrows are pressed on last. A piece that was hidden (the Refining badge,
       Start over) lands the same way when it is needed. */
    .header-logo {
        animation: sticker-press 0.5s var(--ease-standard) 0.05s backwards;
    }

    .btn-cream {
        animation: paper-lay 0.35s var(--ease-standard) 0.2s both;
    }

    .btn-green {
        animation: button-stamp 0.35s var(--ease-standard) 0.3s both;
    }

    .remove-pair-btn {
        animation: pin-push 0.25s var(--ease-standard) 0.25s both;
    }

    .status-sticker:not(.hidden) {
        animation: sticker-stick 0.35s var(--ease-standard) 0.15s both;
    }

    .status-sticker.is-active {
        animation: sticker-stick 0.35s var(--ease-standard);
    }

    button[data-copy-state="copied"] .btn-icon {
        display: inline-block;
        animation: stamp-in 0.3s var(--ease-standard);
    }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    button.btn-green:not(:disabled):hover,
    a.btn-green:hover {
        transform: translateY(-2px);
    }

    button.btn-green:not(:disabled):active,
    a.btn-green:active {
        transform: translateY(1px) scale(0.98);
        transition-duration: 60ms;
    }

    button.btn-cream:not(:disabled):hover,
    label.btn-cream:hover {
        transform: translateY(-1px) rotate(-0.6deg);
    }

    button.btn-cream:not(:disabled):active,
    label.btn-cream:active {
        transform: none;
        transition-duration: 60ms;
    }


    /* A section tab lifts to peek, as it does on the desk and on the account pages. It can
       only do that because it is tucked into its sheet: lifting 2px off an 8px tuck leaves
       6px still joined, so the tab peeks without coming away from the paper. */
    .sub-folder-tab:hover {
        transform: translateY(-2px);
    }

    /* The page-open motion stays first in the list, so hovering never replays it */
    .status-sticker:hover {
        transform: translateY(-3px);
        animation: sticker-stick 0.35s var(--ease-standard) 0.15s both,
                   sticker-wiggle 0.5s var(--ease-standard);
    }

}

@media (max-width: 768px) {
    .dino-desktop {
        display: none !important;
    }
    .dino-mobile {
        display: block !important;
    }
}

/* ============================================================
   RESPONSIVE — 1024px (Tablet)
   Folder tightens, coffee stain shrinks, tabs start scaling
   ============================================================ */

@media (max-width: 1024px) {

    /* Shrink coffee stain */
    .coffee-stain {
        width: 200px !important;
        height: 200px !important;
        top: -40px !important;
        left: -40px !important;
    }

    .controls-bar {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 0.75rem;
    }

    /* Reduce CodeMirror height */
    .CodeMirror {
        height: 280px !important;
    }

    /* Active tab: start shrinking */
    .folder-tab-active {
        font-size: 1.25rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        height: 3rem !important;
    }

    /* Inactive tabs */
    .folder-tab-inactive {
        font-size: 0.875rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        height: 2.25rem !important;
    }

    /* Tabs smaller — reduce overlap so text isn't tucked away; still one width for all four */
    .folder-tabs > * + * {
        margin-left: -0.5rem !important;
    }

    .folder-tabs .folder-tab-active,
    .folder-tabs .folder-tab-inactive {
        min-width: 11rem;
        justify-content: center;
    }

    /* Adjust folder area top margin for smaller tab */
    .folder-area {
        margin-top: 3.5rem !important;
    }
}

/* ============================================================
   RESPONSIVE — 768px (Small Tablet / Large Phone)
   Major layout shifts: stacking, mobile nav, hide desktop chrome
   ============================================================ */

@media (max-width: 768px) {

    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: block;
    }

    /* Add bottom padding to body so content isn't hidden behind nav */
    body {
        padding-bottom: 74px;
    }

    /* Page tabs: a small row at the top right, in the same band as the folder's title tab.
       Tools are switched from the bottom nav, so only the active tool's tab shows up top. */
    .sticky-tabs {
        top: 0;
        width: auto;   /* on phones they lie in a row along the top, so the strip sizes to them */
        transform: translateY(-100%);
        left: auto;
        right: 0.5rem;
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
    }

    .sticky-tab,
    .sticky-tab:hover {
        width: 40px;
        padding-left: 0;
        height: 32px;
        margin-left: 0;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.3);
    }

    .sticky-tab-green {
        border-left: 1px solid rgba(253, 246, 230, 0.15);
        border-bottom: none;
    }

    .sticky-tab-current,
    .sticky-tab-current:hover {
        height: 36px;
        border-left: 1px solid rgba(253, 246, 230, 0.15);
        border-bottom: none;
    }

    .sticky-tab-glyph {
        font-size: 18px;
    }

    /* The business card peeks from the folder's corner here as on a computer, hanging past the
       screen's edge (the body clips it); a tap lifts it the way a hover does */

    /* Hide coffee stain on mobile — overlaps content */
    .coffee-stain {
        display: none !important;
    }

    /* Disable hover lift on folder tabs */
    .folder-tab-active,
    .folder-tab-inactive {
        transform: none !important;
    }

    .folder-tab-active:hover,
    .folder-tab-inactive:hover {
        transform: none !important;
    }

    /* Tab row: tighten to the folder edge on mobile */
    .folder-tabs {
        left: 0.5rem;
    }

    /* Active folder tab on phones: the desktop tab in miniature. The bottom 0.5rem tucks behind
       the folder, leaving 32px showing, level with the page tabs. Like desktop, the name is
       centered on the whole tab, which sets it a little low and gives the high-riding typewriter
       letters room above, and the tab is sized to its name with a little more than a letter
       of room on each side. */
    .folder-tab-active {
        font-size: 1.125rem !important;
        padding-left: 1em !important;
        padding-right: 1em !important;
        padding-bottom: 0 !important;
        height: 2.5rem !important;
        min-width: 0 !important;
        justify-content: center;
        border-top-left-radius: var(--radius-lg) !important;   /* small tabs share the section tabs' 12px corner */
        border-top-right-radius: var(--radius-lg) !important;
    }

    /* Inactive tool tabs: hidden on phones, where the bottom nav switches tools. The current
       tab is then the only one, so it starts at the row's edge wherever it sits in the order. */
    .folder-tab-inactive {
        display: none !important;
    }

    .folder-tabs .folder-tab-active {
        margin-left: 0 !important;
    }

    /* Reduce top margin since tab is smaller */
    .folder-area {
        margin-top: 2.75rem !important;
    }

    /* Folder padding on phones: cozy, not cramped */
    .folder-body {
        padding: 1.5rem !important;
    }

    /* Controls bar: wrap on mobile, flow normally */
    .controls-bar {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }

    /* CodeMirror: shorter on mobile */
    .CodeMirror {
        height: 220px !important;
        font-size: 12px !important;
    }

    /* Page padding: a little wood showing on each side */
    .page-container {
        padding: 0.75rem !important;
    }

    /* Sub-folder panels: room around the writing wells */
    .sub-folder-panel {
        padding: 1rem !important;
    }

    /* Section labels: a step smaller on phones, still readable; the em sizes scale with it */
    .sub-folder-tab {
        font-size: 13px !important;
    }

    /* Header image: smaller on mobile */
    .header-logo {
        max-width: 180px !important;
    }

    /* Header padding: less space needed */
    .header-section {
        padding-top: 0.75rem !important;
        margin-bottom: 1.75rem !important;
    }

    /* Results toolbar: stack on mobile */
    .results-toolbar {
        flex-direction: column !important;
        gap: 0.5rem;
        align-items: stretch !important;
    }

    .results-toolbar > div {
        justify-content: center;
    }
}

/* ============================================================
   RESPONSIVE — 480px (Phone)
   Everything single-column, minimal chrome
   ============================================================ */

@media (max-width: 480px) {

    /* Small phones: one step in, still with a margin */
    .folder-body {
        padding: 1.125rem !important;
    }

    /* CodeMirror: compact */
    .CodeMirror {
        height: 180px !important;
        font-size: 12px !important;
    }

    /* Controls bar: smaller buttons */
    .controls-bar {
        gap: 0.25rem;
    }

    .controls-bar button,
    .controls-bar label,
    .controls-bar .relative {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.625rem !important;
    }

    /* Folder tabs: compact for phone */
    /* Small phones: one step smaller, same proportions, still clear of the page tabs */
    .folder-tab-active {
        font-size: 1rem !important;
        padding-left: 1em !important;
        padding-right: 1em !important;
    }

    .folder-tab-inactive {
        font-size: 0.625rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Minimal overlap on phone */
    .folder-tabs .folder-tab-inactive {
        margin-left: -0.3rem !important;
    }

    /* Sub-folder panels: one step in, still with a margin */
    .sub-folder-panel {
        padding: 0.875rem !important;
    }

    /* Header logo: phone-sized */
    .header-logo {
        max-width: 140px !important;
    }

    /* Page container: a sliver of wood at the edges */
    .page-container {
        padding: 0.5rem !important;
    }
}
/* ============================================================
   HINTS — placeholder text and resting hints in empty boxes
   One quiet ink everywhere: clearly a hint, still easy to read. The html prefix outranks
   Tailwind's own gray placeholder rule, which is added to the page after ours.
   ============================================================ */

html input::placeholder,
html textarea::placeholder,
.hint-text {
    color: var(--ink-a60);
    opacity: 1;
}

/* Trial Mode: a sticker at the folder's top-left corner, lying over the folder, its tabs and
   the dinos, for anyone signed in without a subscription. It is pinned to that corner, so it
   moves with the folder when the page scrolls. It wiggles when touched (mouse only, and never
   with reduced motion), and opens the Tendril Terminal dashboard. */
.trial-mode {
    position: absolute;
    top: -4.5rem;   /* 38px higher than the folder corner used to hold it */
    left: -6rem;   /* far enough left to stay off the folder tabs on the tool pages */
    z-index: 60;   /* the top layer: over the folder (20), its tabs (10) and the dinos (30) */
    width: 9rem;
    rotate: -13deg;   /* stuck on a little crooked, leaning left; rotate rather than transform, so the hover wiggle still works on top */
    transition: transform var(--dur-base) var(--ease-standard);
}

.trial-mode img {
    display: block;
    width: 100%;
    height: auto;
}

.trial-mode[hidden] {
    display: none;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .trial-mode:hover {
        transform: translateY(-3px);
        animation: sticker-wiggle 0.5s var(--ease-standard);
    }
}

/* On phones the sticker is 60% of its desktop size and sticky: it starts inside the folder's
   top-left corner, below the title tab and the page tabs and left of the controls, then stays
   near the top of the screen as the reader scrolls down the folder. The sticky box has no
   height, so it takes no room in the folder; the image hangs from it. (The home page's copy
   in style.css starts half above the folder's edge instead; there is nothing in the way.) */
@media (max-width: 768px) {
    .trial-mode {
        position: sticky;
        display: block;   /* a link is inline by default; without this its width and height would be ignored */
        top: 0;           /* once stuck, the image below sits 0.75rem from the screen top */
        left: auto;
        width: 5.4rem;    /* 60% of the desktop 9rem */
        height: 0;
        margin-left: 1rem;
    }
    .trial-mode img {
        position: relative;
        top: 0.75rem;   /* a little way down from the folder's top edge (a margin here would collapse through the empty box and move the folder) */
    }
}

/* ============================================================
   THE TOUR — the page under a dim, blurred veil, one control clear inside a circle, and a card
   beside the circle that says what it does. The veil's hole is a mask cut out of it: an oval the
   size of the control, feathered at its edge. Its place and size are set by
   /shared/tour.js, which every tool page runs. The same card asks the two opening questions, from the
   middle of the screen, with no hole in the veil.
   ============================================================ */

@property --tour-cx { syntax: '<length>'; inherits: false; initial-value: -200px; }
@property --tour-cy { syntax: '<length>'; inherits: false; initial-value: -200px; }
@property --tour-rx { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --tour-ry { syntax: '<length>'; inherits: false; initial-value: 0px; }

.tour-veil {
    position: fixed;
    inset: 0;
    z-index: 450;   /* over the page and Lookasaurus's floating tool box (400), under its name box (500) */
    pointer-events: none;   /* presses go through to the page, so it can be used while the tour plays */
    background: rgba(61, 43, 31, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    --tour-cx: -200px;
    --tour-cy: -200px;
    --tour-rx: 0px;
    --tour-ry: 0px;
    -webkit-mask-image: radial-gradient(ellipse var(--tour-rx) var(--tour-ry) at var(--tour-cx) var(--tour-cy), transparent calc(100% - 18px), #000 100%);
    mask-image: radial-gradient(ellipse var(--tour-rx) var(--tour-ry) at var(--tour-cx) var(--tour-cy), transparent calc(100% - 18px), #000 100%);
}

/* The hole glides from one stop to the next; while the page scrolls it keeps up without gliding */
.tour-veil.is-moving {
    transition: --tour-cx var(--dur-slow) var(--ease-standard), --tour-cy var(--dur-slow) var(--ease-standard),
                --tour-rx var(--dur-slow) var(--ease-standard), --tour-ry var(--dur-slow) var(--ease-standard);
}

.tour-veil[hidden],
.tour-card[hidden],
.tour-actions[hidden] {
    display: none;
}

/* The card: a small sheet like the name box, beside the circle */
.tour-card {
    position: fixed;
    z-index: 460;
    width: min(340px, calc(100vw - 32px));
    padding: 0.875rem 1.125rem 1rem;
    background: var(--sheet);
    border: 2px solid var(--ink-900);
    border-radius: var(--radius-lg);
    box-shadow: 6px 10px 40px rgba(0, 0, 0, 0.5);
    color: var(--ink-text);
    font-family: var(--font-body);
    outline: none;
}

.tour-count {
    font-family: var(--font-display);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    color: var(--ink-a70);
}

.tour-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    line-height: 1.2;
    margin-top: 0.125rem;
}

.tour-words {
    font-size: var(--text-sm);
    line-height: 1.5;
    margin-top: 0.375rem;
}

.tour-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.875rem;
}

.tour-spacer {
    flex: 1;
}

/* The ? tab is a button among the page's link tabs, and looks the same */
button.sticky-tab {
    cursor: pointer;
    font: inherit;
}

/* On a phone the card lies along the bottom of the screen, above the bottom nav, whatever is circled */
@media (max-width: 768px) {
    .tour-card {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 86px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tour-veil.is-moving {
        transition: none;
    }
}

/* ============================================================
   TWO TABS ON ONE SHEET: Upload Files and Paste Code on Analysaurus, Voice and Apply Voice on
   Notosaurus. Like the tool tabs on the folder: the tab in front is taller and sheet-colored, the
   one behind is shorter, darker and tucked under its neighbor's edge. Both are the sheet labels
   styled above (.sub-folder-tab), here sitting in a row instead of alone.
   ============================================================ */

.input-tabs {
    position: absolute;
    left: 1rem;
    bottom: calc(100% - 8px);   /* tucked into the sheet by the same 8px every other tab is, so
                                   the sheet's top edge stops cutting across the row */
    z-index: 10;
    display: flex;
    align-items: flex-end;
}

.input-tabs .input-tab {
    position: relative;
    top: 0 !important;             /* the row places the tabs; a lone label's lift does not apply */
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease-standard), background-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
}

.input-tabs .input-tab + .input-tab {
    margin-left: -0.75rem;         /* each tab tucks behind its left neighbor */
}

/* The tab in front: the sheet's own label, lying on top */
.input-tabs .input-tab.is-front {
    z-index: 2;
    cursor: default;
}

/* The tab behind: shorter and darker, like a tool tab that is not the current page */
.input-tabs .input-tab:not(.is-front) {
    z-index: 1;
    height: calc(1.6em + 0.5rem) !important;
    background-color: var(--tab-inactive) !important;
    color: var(--ink-a70);
}

.input-tabs .input-tab:not(.is-front):hover {
    background-color: var(--tab-inactive-hover) !important;
    color: var(--ink-text);
    transform: translateY(-2px);
}

.input-tabs .input-tab:focus-visible {
    outline: 2px solid var(--ink-a70);
    outline-offset: 2px;
}

/* ============================================================
   THE GUEST NOTE — at the guest address, a button that would send a call opens this instead:
   a sheet of paper in the middle of the browser screen, over a dimmed desk, asking the visitor
   to create a free account. Built by /shared/guest-gate.js; never shown to anyone signed in.
   ============================================================ */
.guest-note {
    position: fixed;
    inset: 0;
    z-index: 2000;   /* over everything, the tour (1000) included */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
}

.guest-note[hidden] {
    display: none;
}

.guest-note-sheet {
    width: 100%;
    max-width: 26rem;
    padding: 1.75rem 1.5rem 1.5rem;
    background: var(--paper-cream);
    border: 1px solid rgba(69, 26, 3, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-desk);
    text-align: center;
    color: var(--ink-text);
}

.guest-note-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.25;
    color: var(--ink-900);
    margin: 0 0 0.5rem;
}

.guest-note-line {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
}

.guest-note-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.guest-note-actions a.btn-green {
    display: inline-flex;
    align-items: center;
}
