#nafs-id-photo-tool-root {
    font-family: Arial, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    color: #111;
    background: #f3f6fb;
    padding: 18px;
    border-radius: 12px;
    line-height: 1.5;
}

#nafs-id-photo-tool-root * {
    box-sizing: border-box;
}

#nafs-id-photo-tool-root .nafs-tool-header {
    background: #fff;
    padding: 16px 18px;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 18px;
    position: static;
}

#nafs-id-photo-tool-root .nafs-tool-header h2 {
    font-size: 22px;
    margin: 0 0 6px;
    line-height: 1.4;
}

#nafs-id-photo-tool-root .nafs-tool-header p {
    margin: 0;
    color: #444;
    line-height: 1.6;
}

#nafs-id-photo-tool-root .nafs-tool-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

#nafs-id-photo-tool-root .nafs-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
}

#nafs-id-photo-tool-root .nafs-controls {
    max-height: calc(100vh - 110px);
    overflow: auto;
}

#nafs-id-photo-tool-root .nafs-previewPane {
    position: sticky;
    top: 20px;
    align-self: start;
}

#nafs-id-photo-tool-root h3 {
    font-size: 18px;
    margin: 0 0 12px;
    line-height: 1.4;
}

#nafs-id-photo-tool-root h4 {
    font-size: 15px;
    margin: 0 0 8px;
    line-height: 1.4;
}

#nafs-id-photo-tool-root label {
    display: block;
    font-weight: bold;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 6px;
}

#nafs-id-photo-tool-root input,
#nafs-id-photo-tool-root select,
#nafs-id-photo-tool-root button {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

#nafs-id-photo-tool-root select,
#nafs-id-photo-tool-root input[type=file] {
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
}

#nafs-id-photo-tool-root .nafs-btn {
    padding: 10px;
    border-radius: 8px;
    border: 0;
    font-weight: bold;
    margin-top: 10px;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

#nafs-id-photo-tool-root .nafs-btn-black {
    background: #111;
}

#nafs-id-photo-tool-root .nafs-btn-gray {
    background: #e5e7eb;
    color: #111;
}

#nafs-id-photo-tool-root .nafs-btn-red {
    background: #dc2626;
}

#nafs-id-photo-tool-root canvas {
    max-width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid #ddd;
    display: block;
}

#nafs-id-photo-tool-root .nafs-small {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    margin: 6px 0 0;
}

#nafs-id-photo-tool-root .nafs-ok {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.6;
}

#nafs-id-photo-tool-root .nafs-slot {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    background: #fafafa;
}

#nafs-id-photo-tool-root .nafs-active {
    border: 2px solid #2563eb;
    background: #eff6ff;
}

#nafs-id-photo-tool-root .nafs-slot h4,
#nafs-id-photo-tool-root .nafs-slot h3 {
    font-size: 14px;
    margin: 0 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#nafs-id-photo-tool-root .nafs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#nafs-id-photo-tool-root .nafs-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin: 10px 0;
}

#nafs-id-photo-tool-root .nafs-tab {
    padding: 8px 0;
    border-radius: 8px;
    background: #e5e7eb;
    color: #111;
    border: 0;
    font-size: 13px;
    cursor: pointer;
}

#nafs-id-photo-tool-root .nafs-tab.nafs-tab-active {
    background: #2563eb;
    color: #fff;
}

#nafs-id-photo-tool-root .nafs-previewGrid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

#nafs-id-photo-tool-root .nafs-singleWrap canvas {
    width: 240px;
}

#nafs-id-photo-tool-root .nafs-sheetWrap canvas {
    width: 100%;
}

@media (max-width: 1100px) {
    #nafs-id-photo-tool-root .nafs-tool-layout {
        grid-template-columns: 1fr;
    }
    #nafs-id-photo-tool-root .nafs-controls {
        max-height: none;
    }
    #nafs-id-photo-tool-root .nafs-previewPane {
        position: static;
    }
    #nafs-id-photo-tool-root .nafs-previewGrid {
        grid-template-columns: 1fr;
    }
}
