/* Käekirjafont "Käsikiri" stiili jaoks (latin-ext = eesti tähed) */
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

/* ============================================
   Moistekaart — redaktori stiilid
   NB: Redaktor kasutab alati heledat režiimi ($forceLight)
   ============================================ */

/* Peida nav redaktorivaates */
.moistekaart-editor .navbar {
    display: none !important;
}
.moistekaart-editor .section {
    display: none !important;
}
.moistekaart-editor {
    overflow: hidden;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    color: #2c3e50;
    outline: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.header h1:hover {
    background: #f8f9fa;
}

.header h1:focus {
    background: #e8f4f8;
    box-shadow: 0 0 0 2px #3498db;
}

.save-status {
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
}

.btn-back {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #4a90e2;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-download {
    background: #27ae60;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.info-bar {
    background: #34495e;
    color: white;
    padding: 8px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Juhendtekst — ujuv silt canvase all vasakus nurgas, hajub mõne sekundi pärast */
.status-float {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    max-width: min(70vw, 480px);
    opacity: 1;
    transition: opacity 0.6s ease;
}

.status-float.is-faded {
    opacity: 0;
}

.info-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Jaota tööriistagrupid ühtlaselt üle kogu riba laiuse */
    flex: 1;
    justify-content: space-between;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toolbar-btn.active {
    background: rgba(74, 144, 226, 0.7);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.25);
}

.zoom-label {
    font-size: 12px;
    min-width: 42px;
    text-align: center;
    font-weight: 500;
}

.menu-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.picker-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}

.picker-label input[type="color"] {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    background: white;
    padding: 1px;
}

.picker-label input[type="color"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    min-width: 60px;
}

.toolbar-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-select option {
    background: #34495e;
    color: white;
}

.padding-picker-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.padding-picker-label input[type="range"] {
    width: 80px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.padding-picker-label input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.padding-picker-label input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.padding-picker-label input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.padding-picker-label input[type="range"]:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

.padding-picker-label input[type="range"]:disabled::-moz-range-thumb {
    cursor: not-allowed;
}

#paddingValue {
    font-weight: bold;
    min-width: 35px;
    text-align: right;
}

/* Kompaktse stiili definitsioon */
.map-style-compact .node {
    min-width: auto !important;
    width: fit-content !important;
    border-radius: 4px;
    border: none !important;
    box-shadow: none !important;
    text-align: center !important;
}

.map-style-compact .connection-label-text {
    font-size: 10px !important;
}

.map-style-compact .connection-label-bg {
    rx: 3 !important;
    ry: 3 !important;
}

.map-style-compact .connection-line {
    stroke-width: 1.5 !important;
}

.map-style-compact .connection-marker {
    markerWidth: 6 !important;
    markerHeight: 6 !important;
}

.map-style-compact .node.multi-selected {
    border: 2px solid #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4), 0 6px 20px rgba(52, 152, 219, 0.3) !important;
}

.map-style-compact .connection-line.multi-selected {
    stroke: #3498db !important;
    stroke-width: 3 !important;
}

.map-style-compact .node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.map-style-compact .connection-line.hover-active {
    stroke: #7b68ee !important;
    stroke-width: 2.5 !important;
}

/* === Kaardi stiilid: canvas'el on korraga TÄPSELT ÜKS map-style-* klass ===
   (map-style-compact = klassikaline vaikestiil; notes/sketch/mono asendavad selle) */

/* Ühine kastide mõõtuloogika kõigis stiilides (sama mis compact'is) */
.map-style-notes .node,
.map-style-sketch .node,
.map-style-mono .node {
    min-width: auto !important;
    width: fit-content !important;
    text-align: center !important;
}

/* --- Märkmepaberid: post-it kaardid, ruudustik-taust, indigosinised jooned --- */
.canvas.map-style-notes {
    background:
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        #f1f2f4;
    background-size: 80px 80px, 80px 80px, auto;
}

.map-style-notes .node {
    border: none !important;
    border-radius: 2px;
    /* Õrn helendus + vari annavad kleepmärkme efekti; background-color tuleb inline-stiilist */
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.05) 100%);
    box-shadow: 2px 6px 12px rgba(0, 0, 0, 0.22);
}

.map-style-notes .node:nth-of-type(odd) {
    transform: rotate(-0.6deg);
}

.map-style-notes .node:nth-of-type(even) {
    transform: rotate(0.5deg);
}

.map-style-notes .node.dragging,
.map-style-notes .node.multi-selected {
    transform: none;
}

.map-style-notes .node .node-content {
    padding: 8px 14px;
}

.map-style-notes .node.multi-selected {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5), 2px 6px 12px rgba(0, 0, 0, 0.22) !important;
}

.map-style-notes .connection-line {
    stroke: #4a5fc1 !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-style-notes .connection-line.multi-selected {
    stroke: #3498db !important;
    stroke-width: 3.5 !important;
}

.map-style-notes .connection-line.hover-active {
    stroke: #7b68ee !important;
    stroke-width: 3.5 !important;
}

.map-style-notes #arrowhead polygon {
    fill: #4a5fc1;
}

.map-style-notes .connection-label-text {
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    fill: #4a5fc1;
}

.map-style-notes .connection-waypoint {
    stroke: #4a5fc1;
}

/* --- Käsikiri: käekirjafont, "vildikaga" tumedad jooned, kreemjas taust --- */
.canvas.map-style-sketch {
    background: #fdf7ee;
}

.map-style-sketch .node {
    /* Ebaühtlane raadius annab käsitsi joonistatud kuju */
    border-radius: 255px 25px 225px 25px / 25px 225px 25px 255px !important;
    border-width: 2.5px !important;
    box-shadow: none !important;
}

.map-style-sketch .node.multi-selected {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.35) !important;
}

.map-style-sketch .node .node-content {
    font-family: 'Patrick Hand', 'Comic Sans MS', cursive;
    font-size: 19px;
    padding: 4px 10px;
}

.map-style-sketch .connection-line {
    stroke: #2d3436 !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-style-sketch .connection-line.multi-selected {
    stroke: #3498db !important;
    stroke-width: 3.5 !important;
}

.map-style-sketch .connection-line.hover-active {
    stroke: #7b68ee !important;
    stroke-width: 3.5 !important;
}

.map-style-sketch #arrowhead polygon {
    fill: #2d3436;
}

.map-style-sketch .connection-label-text {
    font-family: 'Patrick Hand', 'Comic Sans MS', cursive;
    font-size: 16px !important;
    fill: #2d3436;
}

.map-style-sketch .connection-waypoint {
    stroke: #2d3436;
}

/* --- Visand: mustvalge mõttekaart, ringikujulised mõisted --- */
.canvas.map-style-mono {
    background: #ffffff;
}

.map-style-mono .node {
    background: #ffffff !important;
    background-image: none !important;
    border: 2px solid #222222 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
}

.map-style-mono .node.multi-selected {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.35) !important;
}

.map-style-mono .node .node-content {
    color: #222222 !important;
    padding: 8px 14px;
}

.map-style-mono .connection-line {
    stroke: #222222 !important;
    stroke-width: 1.5 !important;
    stroke-linecap: round;
}

.map-style-mono .connection-line.multi-selected {
    stroke: #3498db !important;
    stroke-width: 2.5 !important;
}

.map-style-mono .connection-line.hover-active {
    stroke: #7b68ee !important;
    stroke-width: 2.5 !important;
}

.map-style-mono #arrowhead polygon {
    fill: #222222;
}

.map-style-mono .connection-label-text {
    fill: #222222;
}

.map-style-mono .connection-waypoint {
    stroke: #222222;
}

.canvas {
    position: relative;
    width: 100%;
    height: calc(100vh - 110px);
    overflow: auto;
    min-height: 300px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    /* Üks sõrm = panimine (natiivne kerimine); pinch-zoom'i käsitleb JS */
    touch-action: pan-x pan-y;
}

.canvas-inner {
    position: relative;
    /* NB: min-mõõte EI tohi CSS-is fikseerida (transform scale korrutaks need üle vaate
       ja tekitaks scrollbarid) — suuruse arvutab updateCanvasSize() zoomi arvesse võttes */
    transform-origin: 0 0;
}

.selection-box {
    position: absolute;
    border: 2px dashed #3498db;
    background: rgba(52, 152, 219, 0.1);
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.connection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.node {
    position: absolute;
    background: white;
    border: 3px solid #666666;
    border-radius: 12px;
    padding: 15px 20px;
    cursor: move;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
    z-index: 10;
    user-select: none;
    white-space: nowrap;
}

.node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.node.dragging {
    opacity: 0.8;
    cursor: grabbing;
    z-index: 1000;
}

.node-content {
    font-size: 16px;
    color: #2c3e50;
    word-wrap: break-word;
    white-space: pre-wrap;
    outline: none;
    min-height: 20px;
    cursor: default;
    user-select: none;
}

.node-content[contenteditable="true"] {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.node-delete {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.node:hover .node-delete {
    display: flex;
}

.node-delete:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.node-connect-icon {
    position: absolute;
    top: -14px;
    left: -14px;
    background: #7b68ee;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.node:hover .node-connect-icon {
    display: flex;
}

.node-connect-icon:hover {
    background: #5a48ce;
    transform: scale(1.15);
}

.node.active {
    border-color: #7b68ee;
    border-width: 4px;
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.node.multi-selected {
    border-color: #3498db;
    border-width: 4px;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4), 0 6px 20px rgba(52, 152, 219, 0.3);
}

.node.active .node-connect-icon {
    display: flex;
    background: #27ae60;
}

.node.active .node-connect-icon:hover {
    background: #229954;
}

body.connecting-mode .node:not(.active):hover .node-connect-icon,
body.connecting-mode .node:not(.active):hover .node-delete {
    display: none;
}

body.connecting-mode .node:not(.active):hover {
    border-color: #7b68ee;
    border-width: 4px;
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.connection {
    pointer-events: all;
    cursor: pointer;
}

.connection-line {
    fill: none;
    stroke: #4a90e2;
    stroke-width: 2;
    pointer-events: none;
}

.connection-line.multi-selected {
    stroke: #3498db !important;
    stroke-width: 3 !important;
}

.connection-line.hover-active {
    stroke: #7b68ee !important;
    stroke-width: 3 !important;
}

/* Nähtamatu laiem tabamisriba — lihtsustab seose joone klõpsamist */
.connection-line-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 14;
    pointer-events: stroke;
    cursor: pointer;
}

/* Murdepunkti pide — nähtav seose hoveril */
.connection-waypoint {
    fill: #ffffff;
    stroke: #4a90e2;
    stroke-width: 2;
    opacity: 0;
    transition: opacity 0.15s ease;
    cursor: grab;
}

.connection:hover .connection-waypoint,
.connection.is-selected .connection-waypoint {
    opacity: 1;
}

.connection-waypoint:hover {
    fill: #7b68ee;
    stroke: #5a48ce;
}

/* Seose hover-riba (✎ tekst + × kustuta) kursori juures */
.conn-hover-toolbar {
    position: absolute;
    display: none;
    gap: 2px;
    padding: 3px;
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    z-index: 950;
    transform-origin: 50% 100%;
}

.conn-tb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a90e2;
    font-size: 13px;
    cursor: pointer;
}

.conn-tb-btn:hover {
    background: rgba(74, 144, 226, 0.12);
}

.conn-tb-btn.conn-tb-danger {
    color: #e74c3c;
}

.conn-tb-btn.conn-tb-danger:hover {
    background: rgba(231, 76, 60, 0.12);
}

.connection-label-bg {
    fill: transparent;
    stroke: none;
    rx: 6;
    cursor: move;
}

.connection-label-bg:hover {
    fill: rgba(123, 104, 238, 0.1) !important;
    stroke: #7b68ee !important;
    stroke-width: 1 !important;
    stroke-dasharray: 3, 3 !important;
}

.connection-label-text {
    fill: #2c3e50;
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.connection-label-input {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    outline: none;
    background: transparent;
    box-shadow: none;
    color: #2c3e50;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.connection-connect-icon-bg {
    fill: #7b68ee;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.connection-connect-icon-bg:hover {
    fill: #5a48ce;
}

.connection-connect-icon-text {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.connection:hover .connection-connect-icon-bg {
    opacity: 1;
}

.connection:hover .connection-connect-icon-text {
    opacity: 1;
}

.connection-label-bg.connection-selected {
    fill: rgba(123, 104, 238, 0.2);
    stroke: #7b68ee;
    stroke-width: 2;
}

.connection-label-bg.multi-selected {
    fill: rgba(52, 152, 219, 0.2);
    stroke: #3498db;
    stroke-width: 2;
}

.connection-delete {
    fill: #e74c3c;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.connection-delete-text {
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.connection:hover .connection-delete {
    opacity: 1;
}

.connection:hover .connection-delete-text {
    opacity: 1;
}

/* Joondusjuhik — kuvatakse, kui lohistatav kast joondub teise kasti tsentriga */
.align-guide {
    stroke: #e91e63;
    stroke-width: 1;
    stroke-dasharray: 5, 5;
    pointer-events: none;
}

.temp-line {
    stroke: #7b68ee;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    fill: none;
    pointer-events: none;
}

/* Undo/redo ja icon-only nupud */
.btn-icon-only {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: #ecf0f1;
    color: #2c3e50;
    transition: all 0.2s;
}

.btn-icon-only:hover:not(:disabled) {
    background: #dfe6e9;
}

.btn-icon-only:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.controls-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

.toolbar-btn-tiny {
    width: 24px;
    height: 24px;
    font-size: 11px;
    padding: 0;
}

/* Abi modal */
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.editor-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
}

.editor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.editor-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.editor-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
}

.editor-modal-close:hover {
    color: #333;
}

.editor-modal-body {
    padding: 16px 20px 20px;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-table td {
    padding: 6px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.shortcuts-table td:first-child {
    width: 55%;
    color: #2c3e50;
    font-weight: 500;
}

kbd {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 12px;
    font-family: monospace;
}

/* ============================================
   Mobiili hoiatus (ainult redigeerimisrežiimis)
   ============================================ */
.mobile-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30000;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mobile-warning-content {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.mobile-warning-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 20px;
}

.mobile-warning-content h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.mobile-warning-content p {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 24px;
    line-height: 1.5;
}

.mobile-warning-content .btn {
    padding: 12px 32px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .mobile-warning {
        display: flex;
    }
    .mobile-warning.is-dismissed {
        display: none;
    }
}

/* ============================================
   Mobiilivaade
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .header h1 {
        font-size: 16px;
        padding: 3px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .save-status {
        font-size: 11px;
    }

    .controls {
        gap: 4px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-label {
        display: none;
    }

    .btn-icon-only {
        padding: 6px 8px;
        font-size: 12px;
    }

    .controls-divider {
        display: none;
    }

    .info-bar {
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 11px;
    }

    #statusText {
        display: none;
    }

    .info-bar-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .menu-actions {
        gap: 4px;
        flex-wrap: wrap;
    }

    .toolbar-group {
        gap: 2px;
    }

    .toolbar-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .toolbar-select {
        min-width: 50px;
        font-size: 11px;
        padding: 3px 4px;
    }

    .zoom-label {
        font-size: 11px;
        min-width: 36px;
    }

    .padding-picker-label input[type="range"] {
        width: 50px;
    }

    .canvas {
        height: calc(100vh - 90px);
        -webkit-overflow-scrolling: touch;
    }
}

/* Jagamise modaal — toggle lüliti */
.share-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.share-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.share-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 28px;
}

.share-switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.share-switch input:checked + .share-switch-slider {
    background-color: #27ae60;
}

.share-switch input:checked + .share-switch-slider:before {
    transform: translateX(24px);
}

.share-switch input:disabled + .share-switch-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Kaart nimekirjas (index.php) */
.mk-map-card {
    position: relative;
}

/* "Jagatud" märgis — alumine parem nurk */
.mk-public-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.25);
    letter-spacing: 0.3px;
    z-index: 1;
}

.mk-public-badge .icon {
    margin: 0 !important;
    height: 12px !important;
    width: 12px !important;
}

.mk-public-badge .icon i {
    font-size: 10px;
}

[data-theme="dark"] .mk-public-badge {
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.5);
}

/* Kaardi tegevusnupud — kompaktsem vahe, alati kõrvuti (Bulma 1.0 kasutab column-gap'i) */
.mk-map-card .buttons {
    column-gap: 3px !important;
    row-gap: 0 !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}

.mk-map-card .buttons .button {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

/* Pikk pealkiri — ellipsis, hover näitab kogu teksti (title atribuut HTML-is) */
.mk-map-card .title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px !important;
}

/* Jagamise modaal — kompaktne layout (nii editor.php kui maps-list.js) */
.mk-share-modal-content {
    max-width: 520px;
}
.mk-share-modal {
    max-width: 520px;
    width: calc(100% - 24px);
}

.mk-share-modal .modal-card-head {
    padding: 16px 20px;
}

.mk-share-modal .modal-card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.mk-share-modal .modal-card-body {
    padding: 20px;
}

.mk-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 14px;
}

.mk-share-row-text {
    flex: 1;
    min-width: 0;
}

.mk-share-row-text strong {
    display: block;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 2px;
}

.mk-share-help {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.4;
    margin: 0;
}

.mk-share-link-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.mk-share-link-input {
    flex: 1;
    min-width: 0;
    font-size: 13px !important;
    background: #f8f9fa !important;
    color: #2c3e50 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mk-share-copy-btn {
    flex-shrink: 0;
    width: 42px;
    padding: 0;
}

.mk-share-copy-btn .icon {
    margin: 0 !important;
}

.mk-share-private-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.mk-share-private-hint .icon {
    color: #95a5a6;
    flex-shrink: 0;
}

/* Tume režiim (maps-list modaali jaoks index.php-s) */
[data-theme="dark"] .mk-share-row,
[data-theme="dark"] .mk-share-private-hint {
    background: var(--bg-hover, #2a2a2a);
}

[data-theme="dark"] .mk-share-row-text strong {
    color: var(--text-primary, #e8e8e8);
}

[data-theme="dark"] .mk-share-help,
[data-theme="dark"] .mk-share-private-hint {
    color: var(--text-secondary, #b0b0b0);
}

[data-theme="dark"] .mk-share-link-input {
    background: var(--bg-hover, #2a2a2a) !important;
    color: var(--text-primary, #e8e8e8) !important;
    border-color: var(--border-color, #444) !important;
}

[data-theme="dark"] .share-switch-slider {
    background-color: #555;
}

/* "Kohalik" märgis — alumine parem nurk (anonüümse kasutaja kaardid) */
.mk-local-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(127, 140, 141, 0.25);
    letter-spacing: 0.3px;
    z-index: 1;
}

.mk-local-badge .icon {
    margin: 0 !important;
    height: 12px !important;
    width: 12px !important;
}

.mk-local-badge .icon i {
    font-size: 10px;
}

[data-theme="dark"] .mk-local-badge {
    box-shadow: 0 2px 6px rgba(127, 140, 141, 0.5);
}

/* Anonüümse redaktori "Logi sisse pilve salvestamiseks" riba */
.local-save-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8e1;
    color: #8a6d3b;
    border-bottom: 1px solid #f0d997;
    padding: 7px 16px;
    font-size: 13px;
    line-height: 1.4;
}

.local-save-banner .icon {
    flex-shrink: 0;
    color: #b8860b;
}

.local-save-banner a {
    color: #8a6d3b;
    text-decoration: underline;
    font-weight: 600;
}

.local-save-banner a:hover {
    color: #5a4624;
}

.local-save-banner-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #8a6d3b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.local-save-banner-close:hover {
    color: #5a4624;
}

@media (max-width: 600px) {
    .local-save-banner {
        font-size: 12px;
        padding: 6px 12px;
    }
}
