@charset "UTF-8";
/* @import url("https://fonts.cdnfonts.com/css/overpass"); */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Overpass:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* @use "reset"; */
:root {
    --foreground: rgb(43, 43, 43); /*#2b2b2b*/
    --background: rgb(247, 247, 247); /*#f7f7f7*/
    --gray: rgba(0, 0, 0, 0.05);
    --dark-gray: rgba(0, 0, 0, 0.25);
}
body {
    background: var(--background);
    color: var(--foreground);
    font-family: monospace, Inter, system-ui,; /*"Overpass", sans-serif;*/
    /* font-feature-settings: "palt"; */
    cursor: pointer;
}
body.dark {
    --foreground: rgba(255, 255, 255, 0.8);
    --background: rgba(0, 0, 0, 0.95);
    --gray: rgba(255, 255, 255, 0.1);
    --dark-gray: rgba(155, 155, 155, 0.3);
}
body main {
    width: 100%;
    height: 100%;
}
body main #grid {
    position: absolute;
    width: 100%;
    height: 100%;
    
    /* High-performance SVG pattern grid with centered dots */
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='0.8' fill='rgba(0,0,0,0.4)'/%3E%3C/svg%3E");
    background-size: 20px 20px;
    
    /* GPU acceleration */
    transform: translate3d(0, 0, 0);
    will-change: transform;

    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}

body.dark main #grid {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='0.8' fill='rgba(255,255,255,0.45)'/%3E%3C/svg%3E");
}
body main section#board {
    /*min-width: 100%;*/
    /*min-height: 100%;*/
    margin: 25px;
    position: absolute;
    cursor: crosshair;

    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;

}
body main section#board.active {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}
body main section#board div#selection {
    position: absolute;
    background-color: var(--gray);
}
body main section#board div.memo {

    font-family: "monaco";
    background-color: var(--background);
    position: absolute;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid var(--foreground);
    user-select: none;
    opacity: 0.95;


    text-align:justify;
    word-break:break-all; 
    text-justify:inter-ideograph;
    text-justify:inter-character;
    word-wrap:break-word;
    overflow-wrap:break-word;

    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
body main section#board div.memo.active {
    user-select: auto;
    box-shadow: 10px 10px var(--dark-gray);
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}
body main section#board div.memo.active div.close, body main section#board div.memo.active textarea.input {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}
body main section#board div.memo div.menu {

    z-index: 1001;
    position: absolute;

    top: 0px;
    right: 0px;
    /*color: var(--foreground);*/

    opacity: 0.5;
    color: #5c5c5c;
    font-size: 14px;
    font-weight: thin;
    text-align: center;
    line-height: 16px;
    width: 16px;
    height: 16px;
    cursor: pointer;

    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
    /* border-bottom: 1px solid var(--foreground); */
}
body main section#board div.memo div.close {
    z-index: 1001;
    position: absolute;
    top: 0px;
    left: 0px;
    opacity: 0.5;
    color: #5c5c5c;
    font-size: 13px;
    font-weight: thin;
    text-align: center;
    line-height: 16px;
    width: 16px;
    height: 16px;
    cursor: pointer;

    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
    /* border-bottom: 1px solid var(--foreground); */
}

body main section#board div.memo div.pin {
    position: absolute;
    top: 0px;
    right: 20px;
    opacity: 1;
    color: var(--dark-gray);
    font-size: 10px;
    font-weight: thin;
    text-align: center;
    line-height: 20px;
    width: 16px;
    height: 16px;
    cursor: pointer;

    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
    /* border-bottom: 1px solid var(--foreground); */
}

body main section#board div.memo div.drag {
    cursor: grab;
    position: absolute;
    top: 0px;
    right: 0px;
    width: 100%;
    height: 20px;
    z-index: 1000;
    /* margin: 1px; */
    /* border-bottom: 1px solid var(--foreground); */
}
body main section#board div.memo div.drag:hover {
    cursor: grab;
}
body main section#board div.memo div.title {

    font-size: 10px;
    font-family: "monaco";

    border: solid 0px #333;
    border-radius: 4px;
    background-color: var(--gray);
    backdrop-filter: blur(2px);

    /* box-shadow: 10px 10px var(--dark-gray); */

    position: absolute;
    z-index: 1001;
    top: 2px;
    left: 18px;
    text-align: left;
    vertical-align: center;

    padding: 2px;
    padding-inline: 4px;

    height: 1.4em;
    line-height: 1.4em;
    /* width: 15%; */
    max-width: calc(100% - 40px);

    font-weight: 900;
    margin: 0;
    outline: 0;
    resize: none;

    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;

    /* margin: 1px; */
    /* border-bottom: 1px solid var(--foreground); */
}

body main section#board div.memo div.counter {
    border-radius: 6px;
    background-color: rgba(150, 150, 150, 0.1);
    backdrop-filter: blur(2px);


    position: absolute;
    z-index: 1000;
    bottom: 10px;
    right: 10px;
    padding-inline: 8px;
    color: var(--foreground);
    /* background-color: var(--background); */
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 16px;
    height: 16px;
    /* border-bottom: 1px solid var(--foreground); */
}
body main section#board div.memo div.resize {
    cursor: nw-resize;
    position: absolute;
    background-color: solid var(--foreground);
    right: 2px;
    bottom: 2px;
    width: 8px;
    height: 8px;
    opacity: 0.3;
    border-bottom: 1.5px solid var(--foreground);
    border-right: 1.5px solid var(--foreground);
}
body main section#board div.memo textarea.input {
    caret-color: #4d4d4d;
    position: absolute;
    top: 17px;
    left: 0px;
    width: calc(100% - 32px);
    height: calc(100% - 49px);

    padding: 16px;
    margin: 0;
    border: 0;
    outline: 0;
    resize: none;
    overflow: auto;
    font-family: "Overpass", "Inter";
    font-size: 12.5px;
    font-weight: 500;

    /*文字詰など*/
    font-feature-settings: "palt";
    text-align:justify;
    word-break:break-all;
    text-justify:inter-ideograph;
    text-justify:inter-character;
    word-wrap:break-word;
    overflow-wrap:break-word;

    cursor: text;
    background: var(--background);
    color: var(--foreground);
    scrollbar-color: var(--foreground) transparent;
    scrollbar-width: thin;

    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}
body main section#board div.memo textarea.input::-webkit-scrollbar {
    width: 1px;
    height: 6px;
}
body main section#board div.memo textarea.input::-webkit-scrollbar-track {
    margin-top: 8px;
    margin-bottom: 13px;
    background: transparent;
}
body main section#board div.memo textarea.input::-webkit-scrollbar-thumb {
    background: var(--foreground);
}
body main section#board div.memo textarea.input::-webkit-scrollbar-thumb:hover {
    background: var(--foreground);
}
body main section#board div.memo textarea.input::-webkit-scrollbar-thumb:active {
    background: var(--foreground);
}
body main section#board div.memo textarea.input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}
body main section#board div.memo div.input {
    caret-color: #E81449;
    position: absolute;
    top: 17px;
    left: 0px;
    width: calc(100% - 32px);
    height: calc(100% - 49px);
    padding: 16px;
    margin: 0;
    border: 0;
    outline: 0;
    resize: none;
    overflow: auto;
    font-family: "Overpass", "Inter";
    font-size: 12.5px;
    font-weight: 500;

    /*文字詰など*/
    font-feature-settings: "palt";
    text-align:justify;
    word-break:break-all;
    text-justify:inter-ideograph;
    text-justify:inter-character;
    word-wrap:break-word;
    overflow-wrap:break-word;

    cursor: text;
    background: var(--background);
    color: var(--foreground);
    scrollbar-color: var(--foreground) transparent;
    scrollbar-width: thin;

    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}
body main section#board div.memo div.input::-webkit-scrollbar {
    width: 1px;
    height: 6px;
}
body main section#board div.memo div.input::-webkit-scrollbar-track {
    margin-top: 8px;
    margin-bottom: 13px;
    background: transparent;
}
body main section#board div.memo div.input::-webkit-scrollbar-thumb {
    background: var(--foreground);
}
body main section#board div.memo div.input::-webkit-scrollbar-thumb:hover {
    background: var(--foreground);
}
body main section#board div.memo div.input::-webkit-scrollbar-thumb:active {
    background: var(--foreground);
}
body main section#board div.memo div.input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Context Menu Styles */
.memo-context-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

body.dark .memo-context-menu {
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.memo-context-menu-item {
    padding: 10px 16px !important;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif !important;
    color: var(--foreground);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .memo-context-menu-item {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.memo-context-menu-item:last-child {
    border-bottom: none !important;
}

.memo-context-menu-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

body.dark .memo-context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.memo-context-menu-item:active {
    background: rgba(0, 0, 0, 0.08) !important;
}

body.dark .memo-context-menu-item:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* History Controls Styles */
.history-controls {
    position: fixed;
    top: 20px;
    right: 100px;
    display: flex;
    gap: 10px;
    z-index: 9998;
}

.history-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    padding: 0;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04);
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    position: relative;
    overflow: hidden;
}

.history-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-btn:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
}

.history-btn:hover:not(.disabled)::before {
    opacity: 1;
}

.history-btn:active:not(.disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.06);
}

.history-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.dark .history-btn {
    background: rgba(30, 30, 30, 0.95);
    color: var(--foreground);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark .history-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.9);
}

.history-btn .icon {
    font-size: 16px;
    line-height: 1;
}


/* Notification Toast - Black tooltip style */
.history-notification {
    position: fixed;
    top: 70px;
    right: 100px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: fadeIn 0.2s ease-out;
    white-space: nowrap;
}

body.dark .history-notification {
    background: rgba(34, 197, 94, 0.9);
}

/* Beautiful CSS Arrow Styles */
.history-btn .arrow {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
}

/* Undo Arrow (←) - Modern curved arrow */
.undo-btn .arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    width: 10px;
    height: 10px;
    border-left: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 1px;
}

.undo-btn .arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    right: 0;
    height: 2.5px;
    background: currentColor;
    transform: translateY(-50%);
    border-radius: 2px;
}

/* Redo Arrow (→) - Modern curved arrow */
.redo-btn .arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 3px;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-50%) rotate(-45deg);
    border-radius: 1px;
}

.redo-btn .arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 2px;
    height: 2.5px;
    background: currentColor;
    transform: translateY(-50%);
    border-radius: 2px;
}

/* Smooth color transitions for arrows */
.history-btn .arrow::before,
.history-btn .arrow::after {
    transition: all 0.2s ease;
}

.history-btn:hover:not(.disabled) .arrow {
    transform: scale(1.1);
}

/* Arrow color adjustments */
.history-btn {
    color: rgba(0, 0, 0, 0.7);
}

body.dark .history-btn {
    color: rgba(255, 255, 255, 0.9);
}


