/* ============================================================
   Bridge Trainer — game design system
   Dark HUD chrome (header/sidebar) around a light play area,
   felt tables, playing-card tiles, gold accents, juicy motion.
   ============================================================ */

/* ---- Base ---- */

.material-symbols-outlined {
    font-variation-settings:
        "FILL" 0,
        "wght" 300,
        "GRAD" 0,
        "opsz" 24;
}

html {
    scrollbar-color: #9aa5ad #e8ebe8;
}

body {
    -webkit-tap-highlight-color: transparent;
    background-color: #f2f2ee;
    background-image:
        radial-gradient(1200px 500px at 85% -10%, rgba(43, 122, 75, 0.07), transparent 60%),
        radial-gradient(900px 420px at -10% 0%, rgba(212, 160, 23, 0.09), transparent 55%);
    background-attachment: fixed;
}

/* Every button feels physical: it sinks a hair when pressed */
button {
    cursor: pointer;
}
button:active:not(:disabled) {
    transform: translateY(1px);
}

/* Subtle scrollbars everywhere */
* {
    scrollbar-width: thin;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-thumb {
    background: #b9c0bf;
    border-radius: 6px;
}
*::-webkit-scrollbar-thumb:hover {
    background: #9aa5ad;
}
*::-webkit-scrollbar-track {
    background: transparent;
}

/* Page entrance */
.page-enter {
    animation: page-enter 0.35s ease both;
}
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* HUD mode dot */
.animate-pulse-dot {
    animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.6);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(212, 160, 23, 0);
    }
}

/* Generic pop for freshly rendered panels (results, overlays) */
.pop-in {
    animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---- Game panels: cards that lift on hover ---- */

.game-panel {
    background: #ffffff;
    border: 1px solid rgba(23, 61, 36, 0.1);
    border-radius: 1rem;
    box-shadow:
        0 1px 2px rgba(16, 22, 30, 0.06),
        0 8px 24px -18px rgba(16, 22, 30, 0.35);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}
.game-panel-hover:hover {
    transform: translateY(-3px);
    box-shadow:
        0 2px 4px rgba(16, 22, 30, 0.08),
        0 18px 34px -18px rgba(16, 22, 30, 0.4);
    border-color: rgba(43, 122, 75, 0.35);
}

/* Gold CTA shared by pages */
.btn-gold {
    background: linear-gradient(180deg, #f2ca4c, #d4a017);
    color: #241a02;
    box-shadow:
        0 3px 0 rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition:
        filter 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.1s ease;
}
.btn-gold:hover {
    filter: brightness(1.06);
}
.btn-gold:active {
    transform: translateY(2px);
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* ---- Playing cards ---- */

/* One card of a hand: rank over suit, like a real playing card.
   Static by design: the table re-renders while waiting for other
   players, so entrance animations here would replay constantly. */
.pcard {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 30px;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffffff, #f4f4ef);
    border: 1px solid rgba(16, 22, 30, 0.18);
    box-shadow: 0 1px 2px rgba(16, 22, 30, 0.2);
    font-family: Manrope, sans-serif;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    user-select: none;
}
.pcard .r {
    font-size: 11px;
}
.pcard .s {
    font-size: 10px;
    margin-top: 1px;
}
.pcard.red {
    color: #c0392b;
}
.pcard.blk {
    color: #17252a;
}
.pcard-sm {
    width: 17px;
    height: 24px;
    border-radius: 3px;
}
.pcard-sm .r {
    font-size: 9px;
}
.pcard-sm .s {
    font-size: 8px;
}
/* Compact cards on phones so a hand never wraps and starves the
   bidding box of space */
@media (max-width: 639px) {
    .pcard {
        width: 17px;
        height: 24px;
        border-radius: 3px;
    }
    .pcard .r {
        font-size: 9px;
    }
    .pcard .s {
        font-size: 8px;
        margin-top: 0;
    }
}

/* Face-down cards: a card-back with a lattice pattern */
.card-back {
    display: inline-block;
    width: 14px;
    height: 30px;
    border-radius: 3px;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.14) 0 2px,
            transparent 2px 5px
        ),
        linear-gradient(160deg, #3c6de0 0%, #274b9e 55%, #1b3574 100%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.45),
        inset 0 0 0 2px rgba(9, 20, 51, 0.35);
}
/* Fanned row of hidden cards */
.card-fan {
    display: flex;
}
.card-fan .card-back {
    margin-right: 2px;
    transform: rotate(-1.6deg);
}
.card-fan .card-back:nth-child(2n) {
    transform: rotate(1.4deg) translateY(1px);
}
.card-fan .card-back:last-child {
    margin-right: 0;
}
@media (max-width: 639px) {
    .card-back {
        width: 11px;
        height: 24px;
    }
}

/* Player plates on the table area */
.player-plate {
    background: linear-gradient(180deg, #fbfcf9, #eef0e9);
    border-radius: 0.85rem;
    border: 1px solid rgba(16, 22, 30, 0.12);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 #ffffff;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}
.player-plate:hover {
    transform: translateY(-2px);
}
.seat-active {
    animation: seat-pulse 1.6s ease-in-out infinite;
}
@keyframes seat-pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(242, 202, 76, 0.65),
            0 2px 4px rgba(0, 0, 0, 0.25);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(242, 202, 76, 0),
            0 2px 4px rgba(0, 0, 0, 0.25);
    }
}

/* Avatar coin on a player plate */
.avatar-coin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    box-shadow:
        inset 0 -2px 0 rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.avatar-you {
    background: linear-gradient(180deg, #f2ca4c, #d4a017);
    color: #241a02;
}
.avatar-partner {
    background: linear-gradient(180deg, #5b8def, #2a5193);
}
.avatar-bot {
    background: linear-gradient(180deg, #43b78d, #1c5535);
}

/* ---- Bidding box (real bridge bidding-box colors) ---- */

.bid-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.4rem;
    border-radius: 0.55rem;
    background: linear-gradient(180deg, #ffffff, #eef0ea);
    border: 1px solid rgba(16, 22, 30, 0.18);
    box-shadow:
        0 2px 0 rgba(16, 22, 30, 0.16),
        inset 0 1px 0 #fff;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        filter 0.1s ease;
}
.bid-tile:hover:not(:disabled) {
    filter: brightness(1.03);
}
.bid-tile:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.bid-tile:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: saturate(0.2);
    box-shadow: none;
    transform: translateY(1px);
}
.bid-tile.selected {
    background: linear-gradient(180deg, #f2ca4c, #d4a017);
    color: #241a02;
    box-shadow:
        0 2px 0 rgba(120, 90, 10, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(120, 90, 10, 0.5);
}

.btn-pass {
    background: linear-gradient(180deg, #37b26a, #1e7d47);
    color: #ffffff;
    box-shadow:
        0 3px 0 rgba(13, 77, 43, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-dbl {
    background: linear-gradient(180deg, #e2543f, #b03226);
    color: #ffffff;
    box-shadow:
        0 3px 0 rgba(120, 30, 20, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-rdbl {
    background: linear-gradient(180deg, #4f7ce8, #2a51b0);
    color: #ffffff;
    box-shadow:
        0 3px 0 rgba(23, 48, 110, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-pass:active,
.btn-dbl:active,
.btn-rdbl:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.btn-pass:disabled,
.btn-dbl:disabled,
.btn-rdbl:disabled {
    opacity: 0.35;
    filter: saturate(0.3);
    box-shadow: none;
    transform: translateY(1px);
    cursor: not-allowed;
}

/* A selected Pass/Double/Redouble in the two-step bidding box: gold ring */
.special-selected {
    box-shadow:
        0 0 0 3px rgba(242, 202, 76, 0.95),
        0 3px 0 rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* ---- Board selector chips ---- */

.board-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 1.9rem;
    padding: 0 10px;
    border-radius: 9999px;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #2d3435;
    border: 1px solid rgba(16, 22, 30, 0.16);
    box-shadow:
        0 2px 0 rgba(16, 22, 30, 0.12),
        inset 0 1px 0 #fff;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}
.board-chip:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}
.board-chip:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.board-chip.chip-selected {
    background: linear-gradient(180deg, #f2ca4c, #d4a017);
    color: #241a02;
    border-color: rgba(120, 90, 10, 0.55);
    box-shadow:
        0 2px 0 rgba(120, 90, 10, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 0 3px rgba(242, 202, 76, 0.35);
}
.board-chip.chip-your-turn {
    background: linear-gradient(180deg, #37b26a, #1e7d47);
    color: #fff;
    border-color: rgba(13, 77, 43, 0.6);
    animation: chip-breathe 2.4s ease-in-out infinite;
}
@keyframes chip-breathe {
    0%,
    100% {
        box-shadow:
            0 2px 0 rgba(13, 77, 43, 0.7),
            0 0 0 0 rgba(55, 178, 106, 0.5);
    }
    50% {
        box-shadow:
            0 2px 0 rgba(13, 77, 43, 0.7),
            0 0 0 6px rgba(55, 178, 106, 0);
    }
}
.board-chip.chip-selected.chip-your-turn {
    background: linear-gradient(180deg, #f2ca4c, #d4a017);
    color: #241a02;
    animation: none;
}

/* ---- Victory / result flourishes ---- */

.victory-imps {
    animation: victory-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes victory-pop {
    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-6deg);
    }
    70% {
        transform: scale(1.12) rotate(1deg);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
.result-glow-pos {
    box-shadow:
        0 0 0 1px rgba(55, 178, 106, 0.35),
        0 0 34px -6px rgba(55, 178, 106, 0.55),
        0 8px 24px -14px rgba(0, 0, 0, 0.4);
}
.result-glow-neg {
    box-shadow:
        0 0 0 1px rgba(226, 84, 63, 0.3),
        0 0 34px -6px rgba(226, 84, 63, 0.45),
        0 8px 24px -14px rgba(0, 0, 0, 0.4);
}

/* Card fan decoration (empty states) */
.card-fan-deco {
    display: flex;
    justify-content: center;
    height: 72px;
    align-items: center;
}
.card-fan-deco .card-back {
    width: 34px;
    height: 52px;
    border-radius: 6px;
    margin: 0 -10px;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 0 0 2px rgba(9, 20, 51, 0.35);
}
.card-fan-deco .card-back:nth-child(1) {
    transform: rotate(-16deg) translateY(8px);
}
.card-fan-deco .card-back:nth-child(2) {
    transform: rotate(-6deg) translateY(2px);
}
.card-fan-deco .card-back:nth-child(3) {
    transform: rotate(0deg);
    z-index: 1;
}
.card-fan-deco .card-back:nth-child(4) {
    transform: rotate(6deg) translateY(2px);
}
.card-fan-deco .card-back:nth-child(5) {
    transform: rotate(16deg) translateY(8px);
}

/* Stat pills (lobby HUD) */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid rgba(16, 22, 30, 0.1);
    box-shadow: 0 2px 0 rgba(16, 22, 30, 0.08);
    font-size: 12px;
}

/* ---- Edit-specific input styles ---- */

.node-name-input {
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 2px 4px;
    outline: none;
    width: 100px;
    display: inline-block;
    vertical-align: middle;
}
.node-name-input:focus {
    background-color: rgba(43, 122, 75, 0.09);
    border-radius: 4px;
}
.node-desc-input {
    border: none;
    background: transparent;
    padding: 2px 4px;
    outline: none;
    width: 320px;
    height: auto;
    min-height: 20px;
    vertical-align: middle;
    white-space: pre-wrap;
    resize: none;
    display: inline-block;
    overflow: hidden;
}
.node-desc-input:focus {
    background-color: rgba(43, 122, 75, 0.09);
    border-radius: 4px;
}

/* Long-form per-node notes: writer + viewer only, practice ignores them */
.node-notes {
    max-width: 60rem;
}
.node-notes-input {
    width: 100%;
    min-height: 4.5rem;
    border: 1px solid rgba(43, 122, 75, 0.25);
    border-radius: 8px;
    background: rgba(43, 122, 75, 0.04);
    padding: 8px 10px;
    outline: none;
    white-space: pre-wrap;
    resize: none;
    overflow: hidden;
    font-size: 16px; /* no iOS Safari focus zoom */
    line-height: 1.45;
}
.node-notes-input:focus {
    border-color: rgba(43, 122, 75, 0.5);
    background: rgba(43, 122, 75, 0.07);
}
.node-notes-view {
    white-space: pre-wrap;
    border-left: 3px solid rgba(43, 122, 75, 0.35);
    background: rgba(43, 122, 75, 0.05);
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    margin: 0.35rem 0 0 1.5rem;
    max-width: 60rem;
}

/* Drag and Drop Visual Feedback */
.dragging {
    opacity: 0.5;
}
.drag-above {
    border-top: 2px solid #2b7a4b;
    border-radius: 4px 4px 0 0;
}
.drag-below {
    border-bottom: 2px solid #2b7a4b;
    border-radius: 0 0 4px 4px;
}
.drag-as-child {
    background-color: rgba(43, 122, 75, 0.07);
    border-radius: 4px;
}

/* Expand/Collapse */
.node-content {
    display: block;
}
.node-content.collapsed {
    display: none;
}

/* Action buttons hidden by default, shown on focus */
.action-buttons {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.node-focused .action-buttons {
    opacity: 1;
    pointer-events: auto;
}

/* Tree list (index page) */
.tree-list-item {
    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}
.tree-list-item:hover {
    background-color: rgba(43, 122, 75, 0.05);
}

/* ---- Toast notification ---- */

.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(14px) scale(0.95);
    background: linear-gradient(180deg, #1a2432, #10161e);
    color: #f9f9f9;
    padding: 11px 22px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 200;
    pointer-events: none;
}
.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.app-toast-error {
    background: linear-gradient(180deg, #b03226, #8f2a1f);
    border-color: rgba(255, 255, 255, 0.18);
}

/* ---- System name field (edit page) ---- */

.system-name-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid rgba(173, 179, 180, 0.3);
    background: transparent;
    padding: 6px 4px;
    outline: none;
    font-size: 18px;
    transition: border-color 0.15s ease;
}
.system-name-input:focus {
    border-bottom-color: #2b7a4b;
}

/* ---- Login / register / share dialogs ---- */

.unlock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 14, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}
.unlock-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(16, 22, 30, 0.1);
    padding: 28px;
    width: 360px;
    max-width: calc(100vw - 32px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: unlock-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes unlock-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.unlock-card h2,
.unlock-card p {
    width: 100%;
}
.unlock-card form {
    width: 100%;
}
.unlock-input {
    width: 100%;
    border: 1.5px solid #c3c9c6;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    background: #f7f8f4;
    color: #2d3435;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}
.unlock-input:focus {
    border-color: #2b7a4b;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(43, 122, 75, 0.15);
}

/* ---- Practice (flashcard) page ---- */

.practice-answer {
    display: none;
}
.practice-answer.revealed {
    display: block;
    animation: answer-in 0.25s ease;
}
@keyframes answer-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Flashcard progress bar (XP-style) */
.xp-bar {
    position: relative;
    height: 10px;
    border-radius: 9999px;
    background: #e2e5e0;
    border: 1px solid rgba(16, 22, 30, 0.12);
    overflow: hidden;
}
.xp-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 9999px;
    background: linear-gradient(90deg, #d4a017, #f2ca4c);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.xp-bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 80%
    );
    animation: xp-sheen 2.6s ease-in-out infinite;
}
@keyframes xp-sheen {
    0% {
        transform: translateX(-100%);
    }
    60%,
    100% {
        transform: translateX(100%);
    }
}

/* ---- Mobile / small screens ---- */

/* Use dynamic viewport height so mobile browser UI doesn't clip content */
.app-shell {
    height: 100vh;
    height: 100dvh;
}

/* Sidebar becomes a slide-in drawer below the header */
#sidebarBackdrop {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 10, 14, 0.55);
    z-index: 30;
}
#sidebarBackdrop.show {
    display: block;
}

@media (max-width: 767px) {
    #sidebar {
        position: fixed;
        top: 4rem;
        left: 0;
        bottom: 0;
        height: auto;
        z-index: 40;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        -webkit-overflow-scrolling: touch;
    }
    #sidebar.open {
        transform: translateX(0);
        box-shadow: 14px 0 40px rgba(0, 0, 0, 0.45);
    }
}

/* ---- Play vs bots: cards, history ---- */

/* Bottom dock clears the iOS home indicator */
.bottom-dock {
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
}

/* Board history overlay */
.history-overlay {
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(6, 10, 14, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.history-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(16, 22, 30, 0.1);
    width: min(780px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    animation: unlock-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@media (max-width: 640px) {
    .history-overlay {
        padding: 0;
    }
    .history-card {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        padding: 12px;
    }
}

/* On touch devices there is no hover/focus, so keep node action buttons visible */
@media (hover: none), (pointer: coarse) {
    .action-buttons {
        opacity: 1;
        pointer-events: auto;
    }
    .action-buttons button {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

/* Stack editor node rows: [toggle, name, actions] then description below */
@media (max-width: 767px) {
    .node-row .node-toggle {
        order: 1;
    }
    .node-row .node-name-input {
        order: 2;
        flex: 1 1 60px;
        width: auto !important;
        min-width: 0;
    }
    .node-row .action-buttons {
        order: 3;
    }
    .node-row .node-desc-input {
        order: 4;
        flex-basis: 100%;
        width: 100% !important;
    }

    /* 16px prevents iOS Safari from zooming in when focusing inputs */
    .node-name-input,
    .node-desc-input,
    .unlock-input,
    select,
    input[type="text"],
    input[type="password"] {
        font-size: 16px !important;
    }

    .app-toast {
        max-width: calc(100vw - 32px);
        text-align: center;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
