/* ============================================================
   YaviMind — iOS-style glass UI
   ============================================================ */
:root {
    --ink: #1c1c28;
    --ink-soft: #5a5f70;
    --ink-faint: #9aa0b0;
    --accent: #5b8cff;
    --accent2: #8a63ff;
    --glass: rgba(255, 255, 255, 0.58);
    --glass-strong: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.65);
    --shadow: 0 10px 40px rgba(30, 40, 90, 0.14);
    --radius: 22px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    background: linear-gradient(160deg, #dfe7ff 0%, #f3e8ff 38%, #ffe9f2 70%, #e8fff6 100%);
}

.hidden { display: none !important; }

/* ---------- animated background orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; filter: blur(70px); }
.bg-orbs i {
    position: absolute; border-radius: 50%; opacity: 0.55;
    animation: orb-float 24s ease-in-out infinite alternate;
}
.bg-orbs i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: #9db9ff; }
.bg-orbs i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 22vh;  background: #d7b3ff; animation-delay: -8s; }
.bg-orbs i:nth-child(3) { width: 42vw; height: 42vw; left: 24vw; bottom: -18vw; background: #ffc4dd; animation-delay: -16s; }
@keyframes orb-float {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(6vw, -5vh) scale(1.12); }
}

/* ---------- glass primitives ---------- */
.glass-card, .glass-panel {
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- auth ---------- */
.auth-body {
    position: relative; z-index: 1;
    height: 100%; display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
body.auth-body { display: flex; } /* verify.php uses body itself */

.auth-card, .verify-card {
    width: 100%; max-width: 400px; padding: 42px 36px;
    text-align: center; position: relative; z-index: 1;
    animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 52px; line-height: 1; margin-bottom: 12px; text-decoration: none;
}
.logo-mark img {
    width: 150px; height: 150px; display: block; border-radius: 38px;
    box-shadow: 0 18px 42px rgba(12, 20, 50, 0.22);
}
.auth-card h1, .verify-card h1 { font-size: 30px; letter-spacing: -0.5px; margin-bottom: 6px; }
.sub { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.sub.small { font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; }

.seg-control {
    display: flex; margin: 26px 0 18px; padding: 4px;
    background: rgba(120, 130, 160, 0.14); border-radius: 14px;
}
.seg {
    flex: 1; border: 0; background: transparent; padding: 9px 0;
    font-size: 14px; font-weight: 600; color: var(--ink-soft);
    border-radius: 11px; cursor: pointer; transition: all 0.25s ease;
    font-family: inherit;
}
.seg.active { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(30, 40, 90, 0.12); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
    padding: 14px 18px; font-size: 15.5px; font-family: inherit;
    border: 1px solid rgba(120, 130, 160, 0.25); border-radius: 14px;
    background: rgba(255, 255, 255, 0.72); color: var(--ink);
    outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.16); }

.btn-primary {
    display: inline-block; border: 0; cursor: pointer; text-decoration: none;
    padding: 14px 26px; font-size: 15.5px; font-weight: 600; font-family: inherit;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 14px; box-shadow: 0 6px 20px rgba(107, 105, 255, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 26px rgba(107, 105, 255, 0.45); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { filter: grayscale(0.4) opacity(0.6); cursor: default; transform: none; }
.btn-primary.slim { padding: 11px 18px; font-size: 14px; }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(120, 130, 160, 0.24); cursor: pointer; text-decoration: none;
    padding: 12px 20px; font-size: 14.5px; font-weight: 700; font-family: inherit;
    color: var(--ink); background: rgba(255, 255, 255, 0.6);
    border-radius: 14px; transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.9); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(0); }

button:focus-visible, input:focus-visible, .map-item:focus-visible {
    outline: 3px solid rgba(91, 140, 255, 0.38);
    outline-offset: 2px;
}

.auth-message {
    margin-top: 16px; padding: 13px 16px; border-radius: 14px;
    font-size: 14px; line-height: 1.45; text-align: left;
    background: rgba(91, 140, 255, 0.13); color: #2d5bd7;
    animation: card-in 0.35s ease;
}
.auth-message.error { background: rgba(255, 90, 90, 0.13); color: #c0392b; }

/* ---------- app layout ---------- */
#app-screen { position: relative; z-index: 1; height: 100%; display: flex; }

#sidebar {
    position: absolute; z-index: 30; left: 14px; top: 14px; bottom: 14px;
    width: 264px; display: flex; flex-direction: column;
    padding: 16px 14px; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
}
#sidebar.collapsed { transform: translateX(-300px); opacity: 0; pointer-events: none; }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }
.logo-small {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; letter-spacing: -0.3px; text-decoration: none; color: inherit;
}
.logo-small img {
    width: 72px; height: 72px; border-radius: 20px; flex: none;
    box-shadow: 0 8px 22px rgba(12, 20, 50, 0.24);
}
.logo-small:hover { opacity: 0.75; }

.map-search-wrap {
    display: flex; flex-direction: column; gap: 5px; margin-top: 12px;
    color: var(--ink-faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase;
}
.map-search-wrap input {
    width: 100%; border: 1px solid rgba(120, 130, 160, 0.22);
    border-radius: 12px; background: rgba(255, 255, 255, 0.58);
    padding: 10px 12px; font: inherit; font-size: 13px; color: var(--ink);
    outline: none;
}
.map-search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.13); }

.map-list { flex: 1; overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-item {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 11px 12px; border-radius: 14px; cursor: pointer;
    transition: background 0.18s; border: 1px solid transparent;
}
.map-item:hover { background: rgba(255, 255, 255, 0.55); }
.map-item.active { background: rgba(255, 255, 255, 0.85); border-color: rgba(91, 140, 255, 0.35); box-shadow: 0 3px 12px rgba(30, 40, 90, 0.08); }
.map-item .m-title { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-item .m-date { font-size: 11px; color: var(--ink-faint); }
.map-list-empty {
    padding: 14px 10px; text-align: center; color: var(--ink-faint);
    font-size: 13px; line-height: 1.4;
}
.map-menu-wrap { position: relative; flex: none; }
.m-menu-btn {
    width: 28px; height: 28px; border: 0; border-radius: 9px; cursor: pointer;
    background: rgba(255, 255, 255, 0.45); color: var(--ink-soft);
    font-size: 17px; line-height: 1; opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.map-item:hover .m-menu-btn, .map-item:focus-within .m-menu-btn, .map-item.active .m-menu-btn { opacity: 1; }
.m-menu-btn:hover { background: rgba(255, 255, 255, 0.9); }
.map-menu {
    position: absolute; right: 0; top: 34px; z-index: 40; min-width: 132px;
    display: none; padding: 6px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(120, 130, 160, 0.18);
    box-shadow: 0 12px 32px rgba(30, 40, 90, 0.18);
}
.map-menu.open { display: grid; gap: 2px; }
.map-menu button {
    border: 0; background: transparent; border-radius: 8px; padding: 8px 10px;
    text-align: left; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px;
}
.map-menu button:hover { background: rgba(91, 140, 255, 0.12); }
.map-menu button.danger { color: #c0392b; }
.map-menu button.danger:hover { background: rgba(255, 90, 90, 0.12); }

.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(120, 130, 160, 0.18); }
.user-chip { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; font-weight: 700; font-size: 15px;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
    border: 0; background: rgba(255, 255, 255, 0.5); cursor: pointer;
    width: 32px; height: 32px; border-radius: 10px; font-size: 15px;
    color: var(--ink-soft); transition: background 0.15s; flex: none;
    font-family: inherit;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.9); }
.icon-btn.floating { position: absolute; z-index: 29; left: 14px; top: 14px; width: 44px; height: 44px; font-size: 18px; border-radius: 14px; }

#workspace { position: relative; flex: 1; }

#topbar {
    position: absolute; z-index: 20; top: 14px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px; padding: 8px 16px;
    border-radius: 16px; max-width: min(520px, 76vw);
}
.map-title {
    border: 0; background: transparent; outline: none; font-family: inherit;
    font-size: 16px; font-weight: 700; color: var(--ink); text-align: center;
    min-width: 60px; width: 240px; letter-spacing: -0.2px;
}
.save-status { font-size: 12px; color: var(--ink-faint); white-space: nowrap; transition: color 0.3s; }
.save-status.saving { color: var(--accent); }
.save-status.error { color: #c0392b; }
.shared-status {
    font-size: 11px; color: #315b35; background: rgba(52, 199, 89, 0.14);
    border: 1px solid rgba(52, 199, 89, 0.22); border-radius: 999px;
    padding: 4px 8px; white-space: nowrap; font-weight: 700;
}

.app-alert {
    position: absolute; z-index: 26; top: 70px; left: 50%; transform: translateX(-50%);
    width: min(560px, 92vw); display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 10px 16px; border-radius: 16px;
    background: rgba(28, 28, 40, 0.88); color: #fff;
    box-shadow: 0 10px 32px rgba(20, 24, 50, 0.22);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.app-alert span { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.app-alert .icon-btn { background: rgba(255, 255, 255, 0.14); color: #fff; }
.alert-action {
    border: 0; border-radius: 10px; background: #fff; color: var(--ink);
    font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 10px; cursor: pointer;
}

/* ---------- canvas ---------- */
#canvas {
    position: absolute; inset: 0; overflow: hidden;
    touch-action: none; cursor: grab;
}
#canvas.panning { cursor: grabbing; }
#canvas.linking { cursor: crosshair; }

#edge-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#edge-layer path.edge {
    fill: none; stroke: rgba(90, 100, 140, 0.34); stroke-width: 2.5;
    pointer-events: stroke; cursor: pointer; transition: stroke 0.15s;
}
#edge-layer path.edge-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
#edge-layer g.selected path.edge { stroke: var(--accent); stroke-width: 3; }
.temp-edge { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 7 6; opacity: 0.85; }

#node-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* ---------- nodes ---------- */
.node {
    position: absolute; transform: translate(-50%, -50%);
    min-width: 90px; max-width: 240px; padding: 13px 20px;
    border-radius: 999px; text-align: center;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    backdrop-filter: blur(16px) saturate(170%);
    border: 1.5px solid var(--glass-border);
    box-shadow: 0 6px 22px rgba(30, 40, 90, 0.13);
    cursor: grab; user-select: none;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
    animation: node-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes node-pop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.node.dragging { cursor: grabbing; box-shadow: 0 14px 38px rgba(30, 40, 90, 0.24); transition: none; animation: none; }
.node.selected { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.22), 0 8px 26px rgba(30, 40, 90, 0.18); }
.node.link-target { border-color: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.28); }

.node .txt {
    display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35;
    outline: none; word-break: normal; overflow-wrap: normal; min-height: 1em; white-space: pre-line;
}
.node .txt[contenteditable="true"] { cursor: text; user-select: text; }

.node .handle {
    position: absolute; right: -11px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; font-size: 14px; line-height: 21px; text-align: center;
    box-shadow: 0 3px 10px rgba(107, 105, 255, 0.4);
    opacity: 0; transform: translateY(-50%) scale(0.6);
    transition: opacity 0.18s, transform 0.18s; cursor: crosshair;
}
.node:hover .handle, .node.selected .handle { opacity: 1; transform: translateY(-50%) scale(1); }

/* node colors */
.node.c1 { background: rgba(255, 255, 255, 0.78); }
.node.c2 { background: rgba(214, 228, 255, 0.82); }
.node.c3 { background: rgba(233, 219, 255, 0.82); }
.node.c4 { background: rgba(255, 221, 235, 0.82); }
.node.c5 { background: rgba(214, 248, 226, 0.82); }
.node.c6 { background: rgba(255, 240, 209, 0.85); }

/* ---------- toolbar ---------- */
#toolbar {
    position: absolute; z-index: 20; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 18px;
    max-width: 94vw; flex-wrap: wrap; justify-content: center;
}
.tool-btn {
    border: 0; background: transparent; cursor: pointer; font-family: inherit;
    font-size: 14px; font-weight: 600; color: var(--ink-soft);
    padding: 9px 13px; border-radius: 12px; transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.tool-btn.icon-only {
    width: 38px; min-width: 38px; height: 38px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.tool-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.75); color: var(--ink); }
.tool-btn:disabled { opacity: 0.35; cursor: default; }
.tool-btn.danger:hover:not(:disabled) { background: rgba(255, 90, 90, 0.14); color: #c0392b; }
.tool-sep { width: 1px; height: 22px; background: rgba(120, 130, 160, 0.25); margin: 0 4px; }
.zoom-label { font-size: 12.5px; color: var(--ink-faint); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }

.color-row { display: flex; gap: 7px; padding: 0 4px; transition: opacity 0.2s; }
.color-row.disabled { opacity: 0.3; pointer-events: none; }
.dot {
    width: 21px; height: 21px; border-radius: 50%; cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 2px 6px rgba(30, 40, 90, 0.18);
    transition: transform 0.15s;
}
.dot:hover { transform: scale(1.2); }
.dot.c1 { background: #ffffff; }
.dot.c2 { background: #aac6ff; }
.dot.c3 { background: #cfb0ff; }
.dot.c4 { background: #ffb7d5; }
.dot.c5 { background: #a9ecc4; }
.dot.c6 { background: #ffdf9e; }

.selection-actions {
    position: absolute; z-index: 23; transform: translate(-50%, -100%);
    display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px;
}
.selection-actions .tool-btn { padding: 8px 10px; font-size: 13px; }

/* ---------- share dialog ---------- */
.share-dialog {
    position: absolute; z-index: 25; top: 74px; left: 50%; transform: translateX(-50%);
    width: min(360px, 92vw); padding: 20px 22px;
    animation: card-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.share-head h3 { font-size: 17px; letter-spacing: -0.3px; }
.sub.left { text-align: left; margin-top: 2px; }
#share-form { display: flex; gap: 8px; margin: 14px 0 4px; }
#share-form input {
    flex: 1; min-width: 0; padding: 11px 14px; font-size: 14px; font-family: inherit;
    border: 1px solid rgba(120, 130, 160, 0.25); border-radius: 12px;
    background: rgba(255, 255, 255, 0.72); outline: none;
}
#share-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15); }
.share-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: 180px; overflow-y: auto; }
.share-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 10px; background: rgba(255, 255, 255, 0.45); font-size: 13px;
}
.share-row .s-mail { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-row .s-name { color: var(--ink-faint); font-size: 11.5px; }
.share-row .s-x { border: 0; background: none; cursor: pointer; opacity: 0.5; font-size: 12px; padding: 2px 5px; border-radius: 6px; }
.share-row .s-x:hover { opacity: 1; background: rgba(255, 90, 90, 0.15); }

.map-item .m-badge { font-size: 12px; flex: none; }
.map-item .m-owner { font-size: 10.5px; color: var(--ink-faint); }

/* ---------- empty state / toast ---------- */
.empty-state {
    position: absolute; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%);
    padding: 44px 48px; text-align: center;
}
.empty-state h2 { margin: 4px 0 6px; letter-spacing: -0.4px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.help-dialog {
    position: absolute; z-index: 27; right: 18px; bottom: 92px;
    width: min(420px, 92vw); padding: 20px 22px;
    animation: card-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.help-grid { display: grid; gap: 10px; margin-top: 14px; }
.help-grid p {
    display: grid; grid-template-columns: 84px 1fr; gap: 10px;
    padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.42);
    font-size: 13px; line-height: 1.35;
}
.help-grid b { color: var(--ink); }
.help-grid span { color: var(--ink-soft); }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 120; display: flex;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(20, 24, 40, 0.26);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.modal-card { width: min(390px, 92vw); padding: 24px; }
.modal-card h3 { font-size: 18px; margin-bottom: 8px; letter-spacing: -0.2px; }
.modal-input {
    width: 100%; margin-top: 14px; border: 1px solid rgba(120, 130, 160, 0.25);
    border-radius: 12px; background: rgba(255, 255, 255, 0.72);
    padding: 12px 14px; font: inherit; outline: none;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.danger-btn {
    background: linear-gradient(135deg, #ff5a5a, #d93b52) !important;
    box-shadow: 0 6px 20px rgba(217, 59, 82, 0.28) !important;
}

.toast {
    position: fixed; z-index: 100; bottom: 84px; left: 50%; transform: translateX(-50%);
    background: rgba(28, 28, 40, 0.88); color: #fff; font-size: 14px; font-weight: 500;
    padding: 12px 22px; border-radius: 999px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: card-in 0.3s ease;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    #sidebar { width: min(78vw, 264px); }
    #topbar { max-width: 72vw; padding: 7px 10px; gap: 7px; }
    .map-title { width: 140px; }
    .empty-state { padding: 32px 24px; width: 86vw; }
    #toolbar {
        bottom: 12px; width: calc(100vw - 24px); justify-content: center;
        gap: 4px; padding: 7px;
    }
    .tool-btn { padding: 9px 10px; }
    .tool-btn.icon-only { width: 40px; min-width: 40px; height: 40px; }
    .dot { width: 24px; height: 24px; }
    .tool-sep { display: none; }
    .selection-actions {
        max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center;
    }
    .help-dialog { left: 50%; right: auto; bottom: 84px; transform: translateX(-50%); }
    .help-grid p { grid-template-columns: 1fr; gap: 3px; }
    .app-alert { top: 64px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
